handler: () => {
this.myFormName.reset();
this.navCtrl.setRoot('HomePage') <--- if lazy loaded
this.navCtrl.setRoot(HomePage) <--- if not lazy loaded
this.navCtrl.pop() <--- if applicable, instead of setRoot()
}
Ah ok. I assumed you were using FormBuilder.
Not sure how to handle clearing the form without using FormBuilder / FormGroup other than manually resetting each value. Not sure how your HTML is set up to get the values. If your fields are just set to
Create a method in your class called handleDone(). Define your alert handler to be _ => this.handleDone(). Put whatever logic you need into the handleDone method.
The convention is that () is used for a function that returns no arguments,
and _ is used if you want to indicate that you ignore any data returned.
However, _ does not play well with the lodash library, which I don’t use
but a lot of people do. The most correct way is probably to do _ignored =>
instead of either () or _. But I haven’t evolved there yet.