I have an angular application now i wish to log the user when he Login till he logout / closes the browser or nagivate to another site.
If the user press the logout button it is fairly easy however the problem occours when the user either closes the browser or nagivate to another site.
My question is how can i detect this in angular and fire an event when the user closes the brower/tab and / or changes webpage?