$templateCache

John Lindquist
InstructorJohn Lindquist

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
~ 7 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 Lindquistinstructor
~ 7 years ago

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