Angularjs-destroy Events
$scope. $on ("$destroy", function () { //clear configuration, otherwise scroll will repeat the request })
Listen for the $destory event in the controller, which is triggered when the page jumps.
After the page jumps, this page listens to some global events, such as the Window.Scroll event will continue to be triggered when the next page scroll
In this callback, clear the current page of the listener or some parameters to ensure that the following page will no longer trigger the current page of the event callback
"Give me a chestnut."
Controller: ' UserInfo '
Verify required Information
$scope. $on ("$destroy", function () {
if (! $scope. currentuser.telephone | |! $scope. currentuser.address) {
Layer.alert ("Please complete the personal information");
$location. Path ("UserInfo");
}
})
Angularjs-destroy Event (page departure event)