As someone new to angularjs, I am currently facing a challenge with catching the onbeforeunload event. My objective is to provide a response to users when they attempt to leave the page. I hope to monitor the onbeforeunload event using $watch and trigger my message display function.
However, I am unsure of how to watch this event. Can anyone offer guidance on this matter? I appreciate any assistance that can be provided. Thank you.