I am using grunts ng-template to store the html templates in the $templateCache. The angular docs suggest that I can use the template like this:
myApp.component('myComponent', {
templateUrl: 'templateId.html'
});
or like this:
myApp.component('myComponent', {
template: $templateCache.get('templateId.html')
});
What is the difference? I do not really like to inject $templateCache in every directive/component just to use this function. Is this about performance?
I have read this article: How much of a performance difference is between template and templateUrl Angularjs and if I am right then using a template (not templateUrl) is a little bit faster. Is this the only difference?