将此作为问答帖子分享。
当您必须在 ui-router 中的路由的 templateProvider
中使用 $templateCache
并必须使用该代码时,该怎么办?注入(inject)不起作用,Angular无法通过引用注入(inject)。
示例:
...
templateProvider : function($templatecache) {
...
},
...
最佳答案
用这个代替:
...
templateProvider : ['$templateCache', function($templateCache) {
...
}],
...
关于javascript - 在 Angular 1.x 中将 $templateCache 与 ui-router 和 uglify 一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39061485/