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
Post a Comment