0

$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?
Kalpana K
  • 59
  • 1
  • 10

1 Answers1

1

Your problem it's probably related to the fact $locationChangeStart it's called even the first time your page load.

Simply get rid of this issue with a flag:

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;
});
illeb
  • 2,942
  • 1
  • 21
  • 35