mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-16 18:17:31 +08:00
chore(packages): move the packages to root
This commit is contained in:
@ -1,32 +0,0 @@
|
||||
|
||||
export function hydrateElement(element: any) {
|
||||
return element.componentOnReady();
|
||||
}
|
||||
|
||||
export function getElement(elementName: string) {
|
||||
return document.querySelector(elementName);
|
||||
}
|
||||
|
||||
export function ensureElementInBody(elementName: string) {
|
||||
let element = getElement(elementName);
|
||||
if (!element) {
|
||||
element = document.createElement(elementName);
|
||||
document.body.appendChild(element);
|
||||
}
|
||||
return element;
|
||||
}
|
||||
|
||||
export function removeAllNodeChildren(element: HTMLElement) {
|
||||
while (element.firstChild) {
|
||||
element.removeChild(element.firstChild);
|
||||
}
|
||||
}
|
||||
|
||||
export function isString(something: any) {
|
||||
return typeof something === 'string' ? true : false;
|
||||
}
|
||||
|
||||
export function getIonApp(): Promise<HTMLIonAppElement> {
|
||||
const element = ensureElementInBody('ion-app') as HTMLIonAppElement;
|
||||
return element.componentOnReady();
|
||||
}
|
Reference in New Issue
Block a user