feat(overlays): adds onDidDismiss and onWillDismiss

This commit is contained in:
Manu Mtz.-Almeida
2018-03-12 21:45:20 +01:00
parent 73f2f2b2b2
commit 7dcf8a5bd4
21 changed files with 207 additions and 164 deletions

View File

@ -1,5 +1,5 @@
import { Component, Listen, Method } from '@stencil/core';
import { AlertEvent, AlertOptions, OverlayController } from '../../index';
import { AlertOptions, OverlayController } from '../../index';
import { createOverlay, dismissOverlay, getTopOverlay, removeLastOverlay } from '../../utils/overlays';
@Component({
@ -10,13 +10,13 @@ export class AlertController implements OverlayController {
private alerts = new Map<number, HTMLIonAlertElement>();
@Listen('body:ionAlertWillPresent')
protected alertWillPresent(ev: AlertEvent) {
protected alertWillPresent(ev: any) {
this.alerts.set(ev.target.overlayId, ev.target);
}
@Listen('body:ionAlertWillDismiss')
@Listen('body:ionAlertDidUnload')
protected alertWillDismiss(ev: AlertEvent) {
protected alertWillDismiss(ev: any) {
this.alerts.delete(ev.target.overlayId);
}