$ scope。$ on(“$ locationChangeStart”,function(event,next,current){
if (!$rootScope.isPopupOpen) {
if ($rootScope.isUrlLoad) {
window.location.reload();
}
}
$rootScope.isUrlLoad = true;
});
In other browser,i have no problem for loading..But in firefox it continuously loading.can anyone please suggest me?
答案 0 :(得分:1)
您的问题可能与$locationChangeStart
即使您第一次加载页面时被调用的事实有关。
只需用旗帜摆脱这个问题:
var firstTime = true;
$scope.$on("$locationChangeStart", function (event, next, current) {
if(firstTime){
firstTime = false;
event.preventDefault();
return;
}
if (!$rootScope.isPopupOpen) {
if ($rootScope.isUrlLoad) {
window.location.reload();
}
}
$rootScope.isUrlLoad = true;
});