Angularjs Google Chrome强制重新加载角度用户界面路由器
当我更改角度视图html时,我使用Ctrl+shift+r在Google Chrome中强制重新加载,但使用角度ui视图标记时,我的部分仍然使用旧缓存为什么?您在路由定义中尝试过类似:cache:false的东西吗?比如:Angularjs Google Chrome强制重新加载角度用户界面路由器,angularjs,google-chrome,Angularjs,Google Chrome,当我更改角度视图html时,我使用Ctrl+shift+r在Google Chrome中强制重新加载,但使用角度ui视图标记时,我的部分仍然使用旧缓存为什么?您在路由定义中尝试过类似:cache:false的东西吗?比如: $stateProvider .state("splash", { url: "/splash", abstract:true, templateUrl:
$stateProvider
.state("splash", {
url: "/splash",
abstract:true,
templateUrl: "/app/view/template/splash/splash.html"
})
.state("index", {
cache: true, //<-- THIS FORCE CACHE
abstract: true,
url: "/index",
templateUrl: "/app/view/template/common/content.html"
})
$stateProvider
.state(“飞溅”{
url:“/splash”,
摘要:没错,
templateUrl:“/app/view/template/splash/splash.html”
})
.state(“索引”{
cache:true,//我已经尝试过缓存,但不起作用,我将尝试应用程序runTry:打开chrome开发工具的“网络”选项卡,然后选中“禁用缓存”
app.run([
"$rootScope", "$templateCache", function($rootScope, $templateCache) {
$rootScope.$on("$routeChangeStart", function(event, next, current) {
if (typeof (current) !== "undefined") {
$templateCache.remove(current.templateUrl); //<-- CLEAN CACHE OF ANGULAR OF HTML TEMPLATE
}
});
}
]);