My use case would be, when I open the modal, a form will appear, while the user fill up the form, the user suddenly click on the backdrop, so the default behavior would be, the modal would be closed.
However, I want to listen on that event because I want to show a modal when the user accidentally click on backdrop which tells that "DO YOU WANT TO SAVE CHANGES?" something like that which generally tells that the form is touched and dirty.
I've read the documentation, and other sources, which tells on the shows something like this
modalRef.result.then((data) => {
// on close
},
(error) => {
// on error/dismiss
});
How do I pass or know that when I clicked on backdrop, the modal which holds the form has been marked touched or dirty so that I could display another modal informing the user for confirmation something like "YOU HAVE UNSAVED CHANGES"
I'm looking for like in Angular Material Dialog they have something like afterClosed subscribe method.
Thanks in advance. Please tell if I miss some code or details to provide.
See the code for the very firs example in the docs: https://ng-bootstrap.github.io/#/components/modal/examples