I am developing angular directives that used html template.
angular.module("app")
.directive("ticket", [function(){
return {
restrict: "E",
templateUrl: "app/ticket/ticket.html"
}
}])
This directive is working and I can change ticket.html content and run application to see changes.
But I read about $templateCache method to increase performance of big projects. And I can use grunt-angular-template to create all of template cache.
But I need to change my directive.
angular.module("app")
.directive("ticket", ["$templateCache",function($templateCache){
return {
restrict: "E",
template: $templateCache.get("app/ticket/ticket.html")
}
}])
Can I separate the build and deployment usage of template.
templateUrl: "app/ticket/ticket.html"template: $templateCache.get("app/ticket/ticket.html")
I will select one of that ways. What is the professional approach for this?