我想使用 $templateCache 服务将一些 html 添加到缓存中。在 Angular 文档示例中,它只显示了在运行中使用它的情况:
var myApp = angular.module('myApp', []);
myApp.run(function($templateCache) {
$templateCache.put('templateId.html', 'This is the content of the template');
});
但是,当我尝试通过 myApp 配置添加一些模板时,似乎存在注入器错误。有没有办法在 RUN 中使用 templateCache?
谢谢