I need to execute a function when the user closes the application, but the following points need to be considered :
- I need to execute a function of one
service
, then... - ... an out-scoped pure-javascript based function is not likely to be useful here
- As I am using routes, a scoped
onLocationChangeSuccess
binding is useless as well
therefore this solution is not going to work : https://stackoverflow.com/a/18355715/773595
Because this will be triggered everytime the location change, but what I need is only one trigger when the tab/window is closed.