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
  • 8,101
  • 11
  • 72
  • 75
Kati
  • 41
  • 1
  • 5

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,688
  • 1
  • 8
  • 20