I was a bit confused by the fact that the NxFormfieldErrorDirective controls remained invalid even after a call to fromGroup.reset().
The answer can be found here because the ErrorStateMatcher checks for form.submitted. That was unexpected for me. I suggest that you include an example like this in the docs:
submitForm(ngForm: FormGroupDirective): void {
// won't work!
// this.myForm.reset();
// resets the form to the initial values and also resets the `submitted` status.
ngForm.resetForm();
}
I was a bit confused by the fact that the
NxFormfieldErrorDirective
controls remained invalid even after a call tofromGroup.reset()
.The answer can be found here because the
ErrorStateMatcher
checks forform.submitted
. That was unexpected for me. I suggest that you include an example like this in the docs:How to reset a form