I am a newbie of angularjs and now I am stack on catching event of onbeforeunload event. I would like to show to some response to user when they leave the page. And I would like to watch onbeforeunload event by $watch and execute my message display function.
But how can I watch that event? Could anybody please answer me? Thank you very much.
How about this:
With $watch which I think you don't need it in here. Something like this: