0

When i am back through the browser back button it will not refreshed but it is from cache of browsers.

i want to reload the page from server while click Back button of browser.

Filburt
  • 17,626
  • 12
  • 64
  • 115
Amit Agarwal
  • 61
  • 1
  • 9

1 Answers1

0

first you can check if user going back like here https://stackoverflow.com/a/19705493/4104866 and then you can refresh

 angular.module('myApp',[...,'ngRoute']
//Route configurations
}])
.run(function($rootScope,$route, $location){

    $rootScope.$on('$locationChangeSuccess', function(){
        $rootScope.actualLocation = $location.path();
    });

    $rootScope.$watch(function() {return $location.path()}, function(newLocation, oldLocation){
        if($rootScope.actualLocation == newLocation){
            //user going back
              $route.reload();
        }
    });

           });

refresh $route.reload

Community
  • 1
  • 1
Kostia Mololkin
  • 868
  • 9
  • 25