the ionic v4 documentation seems to be missing here yet I believe the correct way to access dismiss
from the modal is:
import { Components } from '@ionic/core';
@Component({
selector: 'app-some-modal',
templateUrl: 'some-modal.component.html',
styleUrls: ['some-modal.component.scss']
})
export class SomeModalComponent {
// modal is available here where created with:
// modalController.create({ component: SomeModalComponent})
@Input() modal: Components.IonModal;
onCancel = () =>
this.modal.dismiss('cancel');
}
while the modal
is actually of type HTMLIonModalElement
I am using Components.IonModal
since HTMLIonModalElement
is supposed to be global yet it is not visible to WebStorm/IntelliJ for some reason.