Juan Martin :
If you're using Reactive Forms you can simply use the reset() method on the FormGroup to clear all the form values and mark the controls as pristine again, as it was pointed out already. But you can also use FormGroupDirective to use resetForm(), as this will mark the submitted property of the form as false, something the regular reset() method won't do. \n\nThis is especially helpful if you're using Angular Material, as the default ErrorStateMatcher will check whether the form has been submitted as one of the conditions to display the form error messages. You can use it like this:\n\n@ViewChild(FormGroupDirective) formRef: FormGroupDirective;\n\n\nAnd then:\n\nthis.formRef.resetForm();\n\n\nNo need to add anything to your HTML.\n\nFor more info: https://github.com/angular/angular/pull/10715",
2019-06-09T22:16:03