I am trying to display the html part available on a dynamic route, the route is selected by calling $http.get() , it returns the html part,
Just to give an example, I am trying to download this html fragment:
<h1>{{ pagetitle }}</h1> this is a simple page example
I made a little fiddle to mock the problem, but for simplicity I left the http call and just added html to the line in the area.
Controller:
function Ctrl($scope) { $scope.data = { view: "<h1>whaaaaa</h1>" }; }
Html page:
<div ng-app=""> <div ng-controller="Ctrl"> <div ng-include src="data.view"></div> </div> </div>
The problem is that it does not add the line to the html file (ng-include), but does the URL of the URL made from that line, apparently.
So is it not possible to just enter a string in include? if not, how can you make an http call to a dynamic URL and enter the return URL on the page.
You can play with it in JSFiddle .
angularjs
Sander Aug 09 '13 at 14:33 2013-08-09 14:33
source share