chore(packages): move the packages to root

This commit is contained in:
Brandy Carney
2018-03-12 16:02:25 -04:00
parent 097f1a2cd3
commit d37623a2ca
1255 changed files with 38 additions and 38 deletions

22
react/src/apis/apis.ts Normal file
View File

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