Can AngularJS listen for $locationChangeSuccess on refresh?

后端 未结 2 717
春和景丽
春和景丽 2021-01-03 21:36

I am listening for $locationChangeSuccess in Angular using this code:

$scope.$on(\'$locationChangeSuccess\', function(event) {
  console.log(\'C         


        
2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-03 22:19

    You probably want a listener on window.onbeforeunload which is called just before the window unloads it's resources (refresh).

提交回复
热议问题