0

Sharing this as a Qusstion-answer post.

What to do when you have to use $templateCache in templateProvider of a route in ui-router and have to utility the code? Injecting does not work, and angular cannot inject by reference.

Example :

...  
templateProvider : function($templatecache) {

    ...

},

...
Sushruth
  • 1,074
  • 1
  • 9
  • 14

1 Answers1

1

Use this instead :

...  
templateProvider : ['$templateCache', function($templateCache) {

    ...

}],

...
Sushruth
  • 1,074
  • 1
  • 9
  • 14