In an Angular reactive form. How to reset only the state of form after successful submit?
Here is the process:
For reactive forms what worked for me when using angular 7: was to use template-driven form and pass it via the form submit handler like so
// component.html
// component.ts
onSubmit(form: NgForm) {
// reset form here
form.form.markAsPristine();
form.resetForm();
}
It will reset the form and the submitted state to default.