Currently, I am working on an AngularJs application that consists of two ng-views. One issue that I have encountered is with the 'onbeforeunload' event. While it works fine when navigating away from the page or refreshing it, it does not trigger when switching between the ng-views.
Can anyone suggest a way to ensure that the 'onbeforeunload' event fires when transitioning between ng-views?
Thank you for your help!