Reputation: 1
I have a template which I need to show the path of a template dynamically.
<div data-ng-include="'app/templates/'templateUrl'.html'"></div>
$scope.templateUrl = "text";
But the link is not mapped as :
app/templates/text.html
Can any one please help me. Thanks.
Upvotes: 0
Views: 33
Reputation: 68665
Try this way. Make a string by concatenating the parts.
<div data-ng-include="'app/templates/' + {{ templateUrl }} + '.html'"></div>
Upvotes: 1