AngularJS directive 动态 template
app.directive('testwindow', function() { return { restrict : 'E', template: '<ng-include src="getTemplateUrl()"/>', replace: true, controller:function($scope, $element ,$http){ $scope.getTemplateUrl=function(){ var url= getWebRoot() + "/views/"+ $scope.dataStore.elementType +".html"; return url; }; }
是个比较好的解决方案,mark