I need to trigger if the user close the browser to turn the status of the user from online to offline after the browser session ended by 15 minutes.
Asked
Active
Viewed 534 times
2
-
Does this answer your question? [How can I handle browser tab close event in Angular? Only close, not refresh](https://stackoverflow.com/questions/34129319/how-can-i-handle-browser-tab-close-event-in-angular-only-close-not-refresh) – Eggcellentos Jul 02 '20 at 08:30
1 Answers
0
If you want to implement in Angular use
@HostListener('window:beforeunload', ['$event'])
handleBeforeUnload(event) {
// add confirm box and place your code accordingly }
and implement ComponentCanDeactivate.
Hope this helps you.

Rahul
- 154
- 1
- 9