mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
docs(): update examples and usage
This commit is contained in:
@@ -28,7 +28,7 @@ export class LoadingController implements OverlayController {
|
||||
removeLastOverlay(this.loadings);
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Create a loading overlay with loading options.
|
||||
*/
|
||||
@Method()
|
||||
@@ -36,7 +36,7 @@ export class LoadingController implements OverlayController {
|
||||
return createOverlay(this.doc.createElement('ion-loading'), opts);
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Dismiss the open loading overlay.
|
||||
*/
|
||||
@Method()
|
||||
@@ -44,7 +44,7 @@ export class LoadingController implements OverlayController {
|
||||
return dismissOverlay(data, role, this.loadings, loadingId);
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Get the most recently opened loading overlay.
|
||||
*/
|
||||
@Method()
|
||||
|
||||
@@ -3,19 +3,6 @@
|
||||
Loading controllers programmatically control the loading component. Loadings can be created and dismissed from the loading controller. View the [Loading](../../loading/Loading) documentation for a full list of options to pass upon creation.
|
||||
|
||||
|
||||
```javascript
|
||||
async function presentLoading() {
|
||||
const loadingController = document.querySelector('ion-loading-controller');
|
||||
await loadingController.componentOnReady();
|
||||
|
||||
const loadingElement = await loadingController.create({
|
||||
content: 'Please wait...',
|
||||
spinner: 'crescent',
|
||||
duration: 2000
|
||||
});
|
||||
return await loadingElement.present();
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
<!-- Auto Generated Below -->
|
||||
|
||||
13
core/src/components/loading-controller/usage/javascript.md
Normal file
13
core/src/components/loading-controller/usage/javascript.md
Normal file
@@ -0,0 +1,13 @@
|
||||
```javascript
|
||||
async function presentLoading() {
|
||||
const loadingController = document.querySelector('ion-loading-controller');
|
||||
await loadingController.componentOnReady();
|
||||
|
||||
const loadingElement = await loadingController.create({
|
||||
content: 'Please wait...',
|
||||
spinner: 'crescent',
|
||||
duration: 2000
|
||||
});
|
||||
return await loadingElement.present();
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user