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

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

javascript - jquery or ashx not working -

inno setup - TLabel or TNewStaticText - change .Font.Style on Focus like Cursor changes with .Cursor -