我一直在包含多視圖視圖的角度MVC應用程序中工作。 我有一些templateURL標籤Angular Tabs在「ng-include src」中呈現緩存模板
我已爲此做了標籤集就像
$scope.templateUrl = '';
var tabs = $scope.tabs =
[];
var controller = this;
this.selectTab = function(tab)
{
$templateCache.put(tab, tab.templateUrl);
angular.forEach(tabs, function(tab)
{
tab.selected = false;
});
tab.selected = true;
};
this.setTabTemplate = function(tab,templateUrl)
{
$scope.templateUrl = $templateCache.get(tab);
}
this.addTab = function(tab)
{
controller.selectTab(tab);
tabs.push(tab);
};
<ng-include src="templateUrl"></ng-include>
我有緩存的快速檢索的模板。 使用ng-include和模板URL(來自Spring Dispatcher Servlet)與$ templateCache不兼容。
請建議我如何達到相同。
在此先感謝。
您應該將此標記爲正確答案 – MoLow