refactor(modal): use framework delegate for mounting the user's component

This commit is contained in:
Dan Bucholtz
2017-12-14 00:10:52 -06:00
parent c30337bf8c
commit ec33d4e725
35 changed files with 546 additions and 148 deletions

View File

@ -0,0 +1,13 @@
import { ModalOptions } from '@ionic/core';
import { Delegate } from '../react-framework-delegate';
import { getOrAppendElement } from '../utils/helpers';
export function createModal(opts: ModalOptions): Promise<HTMLIonModalElement> {
opts.delegate = Delegate;
const element = getOrAppendElement('ion-modal-controller') as HTMLIonModalControllerElement;
return (element as any).componentOnReady().then(() => {
return element.create(opts);
});
}