How do you reset the form?
In a model-driven form, you can reset the form just by calling the function reset()
on our form model. For example, you can reset the form model on submission as follows,
onSubmit() {if (this.myform.valid) {console.log("Form is submitted");// Perform business logic herethis.myform.reset();}}
Now, your form model resets the form back to its original pristine state.
May 04, 2022
181
Read more
What is Angular Framework?
November 04, 2022
AngularWhat is a Angular module?
November 03, 2022
AngularWhat are the steps to use animation module?
October 31, 2022
Angular