2016-09-23 6 views
0

$の範囲で動作していません。$( "$ locationChangeStart" に、機能(次のイベント、現在の){

 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? 

答えて

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; 
}); 
+0

感謝を –