How do I dynamically build an ng-include src?
问题 I have the following code: <div ng-repeat="module in modules" id="{{module.Id}}"> <ng-include ng-init="bootstrapModule(module.Id)" src=""></ng-include> </div> I want to be able to build a string in src like so: /modules/{{module.Name}}/{{module.Name}}.tpl.html But I keep hitting roadblocks. I've tried to use a call back function to build it, $scope.constructTemplateUrl = function(id) { return '/modules/' + id + '/' + id + '.tpl.html'; } But this gets called over & over & over and it doesn't