DEV Community

Discussion on: Warn User Of Unsaved Changes to Angular Form

Collapse
 
pinich profile image
Pini Cheyni

Great idea to catch this event on route change !
Can it somehow be implemented if the route doesn’t change ? (For example when the form is inside of a modal)

Collapse
 
nightwolfdev profile image
nightwolfdev

If the user closes the modal by mistake, you could listen for that modal close event and if the form is considered dirty, warn the user at that moment.