Reputation: 1525
I can open the modal just fine, but it isn't clear to me from any documentation whether there is a straight forward method to close the modal. I thought there was a dismiss method already on ModalController, but the log errors say otherwise. The ionic documentation isn't helpful enough. Does anyone know where else to point me?
import { ModalController, ViewController } from 'ionic-angular';
constructor(public modalCtrl: ModalController) {
}
Dismiss() {
this.modalCtrl.dismiss();
}
Upvotes: 0
Views: 693
Reputation: 2702
Solution is attached below:
import { ModalController, ViewController } from 'ionic-angular';
constructor(public viewCtrl: ViewController) {
}
Dismiss() {
this.viewCtrl.dismiss();
}
Upvotes: 1
Reputation: 1760
This is from the doc.
The modal can later be closed or "dismissed" by using the ViewController's dismiss method.
https://ionicframework.com/docs/api/components/modal/ModalController/
Upvotes: 1