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; }; }
是個比較好的解決方案,markhtml