angular.js - How to listen to browser close event in angular js
为情所困2017-05-15 17:09:24
0
1
778
Using angular to develop web, I want to save the current data to localStorage when the user closes the browser. But there is no way to monitor the browser closing event in the controller. Please give me some ideas! ! Thank you so much!
angularjs should not have this method, you can try window.onbeforeunload.