Ng-include src binding using $ scope property
In angularjs app I want to load partial view dynamically, so I mean
<ng-include src="'{{ pathView }}'"></ng-include>
this view is of course associated with a specific controller, and in my controller i have
$scope.pathView= "/templates/listView.html";
it doesn't work as when examining the html view I get
<!-- ngInclude: undefined -->
When I hardcode the path to the template
<ng-include src="'/templates/listView.html'"></ng-include>
it works.
What am I doing wrong?
+3
source to share