0

I have a modal popup. It has a form-group-like registration form. And it has fields like text, checkbox, select. If the user changes any form controls without saving the form, and then tries to close the modal popup, I would like to show a warning message to force saving changes or leaving the popup.

I've seen this Q&A, but I don't understand how it works. Where can I get the form-got-changed status in the FormIntactChecker class?

honk
  • 9,137
  • 11
  • 75
  • 83
Kati
  • 51
  • 1
  • 6

1 Answers1

0

you can do it like so

form = FormGroup({}); // create your FormGroup here or if you already have it, just check 
if (this.form.dirty) {}
Artyom Amiryan
  • 2,846
  • 1
  • 10
  • 22