mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-16 01:52:19 +08:00
14 lines
460 B
TypeScript
14 lines
460 B
TypeScript
|
|
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);
|
|
});
|
|
}
|