当我在代码中对任何模板 (html) 进行更改并从浏览器刷新时,应用程序中不会发生更改。
当我在任何模板中进行更改时,我想绕过模板缓存,即当我在模板中进行任何更改并从浏览器刷新时,我希望代码应该是更新的代码而不是$templateCache
.
我怎么知道以编程方式模板有任何变化?
我也从 Stackoverflow 参考中尝试过这段代码。
app.run(function($rootScope, $templateCache) {
$rootScope.$on('$viewContentLoaded', function($event) {
console.log($event);
alert("abc");
//$templateCache.removeAll();
$templateCache("templates").removeAll();
});
});