angularjs - Call Angular Controller function on application Close -


i want execute function before application close. have code executing before route changes fine, want execute same function if close application instead of changes route..is there way?

 $scope.$on('$destroy', function () {                  element.autosave();              }); 

the "onbeforeunload" event fires before window starts unloading resources. more info here: mdn onbeforeunload

beware of on handler, browser not complete, example, ajax request before unloading.


Comments

Popular posts from this blog

hibernate - How to load global settings frequently used in application in Java -

python 3.x - Mapping specific letters onto a list of words -

objective c - Ownership modifiers with manual reference counting -