Thanks for idea.

How can I do that? Which properties of event should I look for?

I should cover the following:
- Browser close
- Tab close
- f5
- ctrl+f5
- refresh button click
- ctrl+w

On Thursday, December 31, 2015 at 9:44:03 PM UTC+1, Robert Ferentz wrote:
>
> No direct way to do it. Javascript doesn't differentiate between types of 
> leaving the page, like reload, link, submit, closing tab etc. 
>
> You have one event called "beforeunload" on the window object which is 
> called on any of the above actions. You CAN however, inside that event, 
> check if the mouse was outside the viewport when the window was closed, or 
> if certain combinations of keys were pressed that are known to close a tab 
> or window.
>
> On Thursday, December 31, 2015 at 9:46:59 PM UTC+2, zenn....@gmail.com 
> wrote:
>>
>> Hello, 
>>
>> All the best in New Year!!!
>>
>> What is best practice to cleanup AngularJS app. 
>>
>> What I need is to delete specific cookies, and specific data from local 
>> storage when user closes the tab or browser. But those cookies and local 
>> storage data should not be deleted on page reload.
>>
>> Regards,
>> Z
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to