I have a Modal in Ionic 4. I\'d like to close it, when a user press the back button on her mobile (or the bac
Update, for Ionic 5 (Angular)
in your-modal.page.ts
import { ModalController } from '@ionic/angular';
at the top of your modal's .ts file. Then in your constructor you can just denote a -public- relationship to the controller, that way it's accessible by your view.
also in your-modal.page.ts
constructor(
public modalCtrl: ModalController
) {}
Now you can inline the close command:
in your-modal.page.html
Modal Title
Slot "primary" makes the buttons move to the right in iOS.