I have a form that displays a list of elements. They all share a common save button which is disabled until the form becomes dirty. Then
If you happen to be using Template-Driven forms and you have something like this in your component:
@ViewChild('myForm') myform: NgForm;
I've found that the markAsPristine()
is a function on the form property of your form. So it would be this.myform.form.markAsPristine()
.
Just thought I'd add this in case others come across markAsPristine()
as not being defined.