ion-loading-controller

Contents

Loading controllers programmatically control the loading component. Loadings can be created and dismissed from the loading controller. View the Loading documentation for a full list of options to pass upon creation.

Usage

javascript
async function presentLoading() {
  const loadingController = document.querySelector('ion-loading-controller');
  await loadingController.componentOnReady();

  const loadingElement = await loadingController.create({
    message: 'Please wait...',
    spinner: 'crescent',
    duration: 2000
  });
  return await loadingElement.present();
}

Methods

create

Description

Create a loading overlay with loading options.

Signature create(opts?: LoadingOptions | undefined) => Promise<HTMLIonLoadingElement>

dismiss

Description

Dismiss the open loading overlay.

Signature dismiss(data?: any, role?: string | undefined, id?: string | undefined) => Promise<boolean>

getTop

Description

Get the most recently opened loading overlay.

Signature getTop() => Promise<HTMLIonLoadingElement | undefined>