$templateCache

Share this video with your friends

Send Tweet

An alternative to inject an AngularJS template by using $templateCache, using .get() and .put() methods

Karen
Karen
~ 10 years ago

I wonder why we can't get the template in the app.run section, when, for example, we load a template within a ng-template script in the main html file?

John Lindquist
John Lindquist(instructor)
~ 10 years ago

'<script type="text/ng-template">...' is a directive (https://docs.angularjs.org/api/ng/directive/script) and app.run executes before directives.