I have been working in angular MVC application containing multitab views. I have a tabset with some templateURL tabs
What I have done for this is like
$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>
I have to cache the templates for fast retrieval. Using ng-include and template URL (that is coming from Spring Dispatcher Servlet) in it with $templateCache not working for me.
Please suggest how can I achieve the same.
Thanks in advance.