Saturday, October 14, 2017

Display a customized confirm box in angularjs when user leaves a page

My requirement is to display a customized confirm box when the user leaves a page without saving form data.

I used the window.onbeforeunload event it is displaying google chrome related predefined confirm box. When the user changes any form and trying to reload, tab close or route change I want to display a $mdDialog.confirm and asking user to leave the page or stay on the same page. How do I make one?

Source: AngularJS



from Angular Questions https://angularquestions.com/2017/10/14/display-a-customized-confirm-box-in-angularjs-when-user-leaves-a-page/
via @lzomedia #developer #freelance #web #lzomedia.com

No comments:

Post a Comment