refactor(): deprecate web component controllers (#19109)

This commit is contained in:
Manu MA
2019-08-27 14:00:45 +02:00
committed by GitHub
parent 3e63b3c2c4
commit a65d897214
71 changed files with 1435 additions and 1461 deletions

View File

@@ -1,4 +1,4 @@
import { Component, ComponentInterface, Method } from '@stencil/core';
import { Build, Component, ComponentInterface, Method } from '@stencil/core';
import { LoadingOptions, OverlayController } from '../../interface';
import { createOverlay, dismissOverlay, getOverlay } from '../../utils/overlays';
@@ -8,6 +8,14 @@ import { createOverlay, dismissOverlay, getOverlay } from '../../utils/overlays'
})
export class LoadingController implements ComponentInterface, OverlayController {
constructor() {
if (Build.isDev) {
console.warn(`[DEPRECATED][ion-loading-controller] Use the loadingController export from @ionic/core:
import { loadingController } from '@ionic/core';
const modal = await loadingController.create({...});`);
}
}
/**
* Create a loading overlay with loading options.
*

View File

@@ -8,25 +8,6 @@ Loading controllers programmatically control the loading component. Loadings can
<!-- Auto Generated Below -->
## Usage
### Javascript
```javascript
async function presentLoading() {
const loadingController = document.querySelector('ion-loading-controller');
const loadingElement = await loadingController.create({
message: 'Please wait...',
spinner: 'crescent',
duration: 2000
});
return await loadingElement.present();
}
```
## Methods
### `create(options?: LoadingOptions | undefined) => Promise<HTMLIonLoadingElement>`

View File

@@ -1,12 +0,0 @@
```javascript
async function presentLoading() {
const loadingController = document.querySelector('ion-loading-controller');
const loadingElement = await loadingController.create({
message: 'Please wait...',
spinner: 'crescent',
duration: 2000
});
return await loadingElement.present();
}
```