differenciate refresh and browser close event in angularjs

12 views
Skip to first unread message

Viswanath Nath

unread,
Feb 11, 2020, 1:56:02 PM2/11/20
to Angular and AngularJS discussion
when we do refresh or browser close $window.onbeforunload is getting called but not able differentiate between the both. (Trying to crack it from 2 weeks but not able to do it)

Sander Elias

unread,
Feb 13, 2020, 2:29:13 PM2/13/20
to Angular and AngularJS discussion
Hi Viswanath,

It is one and the same event, so there is no way to differentiate. As a refresh in a browser is actually the same as closing and opening the same site.

Regards
Sander
Reply all
Reply to author
Forward
0 new messages