Closed hank-hong closed 7 years ago
You can detect the JS onunload
and onbeforeunload
events, and then fire a localStorageService
clear call.
http://stackoverflow.com/questions/30345446/how-to-trigger-a-function-on-window-close-using-angularjs has more details for this.
Hello,
I found if I used localstorage, the data will always be saved even though I closed the browser. Buf if I use sessionstorage, the data won't be shared in multiple tabs.
Could you please give me some suggestion? Thanks