0

将此作为 Qusstion-answer 帖子分享。

当您必须在 ui-router 中使用$templateCache路由templateProvider并且必须使用代码时该怎么办?注入不起作用,角度不能通过引用注入。

例子 :

...  
templateProvider : function($templatecache) {

    ...

},

...
4

1 回答 1

1

改用这个:

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

    ...

}],

...
于 2016-08-21T06:38:04.633 回答