docs(overlays): add usage by framework

This commit is contained in:
Brandy Carney
2018-04-02 18:28:54 -04:00
parent 3d6a6bad8f
commit 685d5a166c
9 changed files with 155 additions and 50 deletions

View File

@ -13,21 +13,6 @@ Loading indicators can be created using a [Loading Controller](../../loading-con
The loading indicator can be dismissed automatically after a specific amount of time by passing the number of milliseconds to display it in the `duration` of the loading options. By default the loading indicator will show even during page changes, but this can be disabled by setting `dismissOnPageChange` to `true`. To dismiss the loading indicator after creation, call the `dismiss()` method on the loading instance. The `onDidDismiss` function can be called to perform an action after the loading indicator is dismissed.
```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 -->

View File

@ -0,0 +1,34 @@
```javascript
import { Component } from '@angular/core';
import { LoadingController } from '@ionic/angular';
@Component({
selector: 'loading-example',
templateUrl: 'loading-example.html',
styleUrls: ['./loading-example.css'],
})
export class LoadingExample {
constructor(public loadingController: LoadingController) {}
presentLoading() {
const loading = this.loadingController.create({
message: 'Hellooo',
duration: 2000
});
loading.present();
}
presentLoadingWithOptions() {
const loading = this.loadingController.create({
spinner: 'hide',
duration: 5000,
content: 'Please wait...',
translucent: true,
cssClass: 'custom-class custom-loading'
});
loading.present();
}
}
```

View File

@ -0,0 +1,26 @@
```javascript
async function presentLoading() {
const loadingController = document.querySelector('ion-loading-controller');
await loadingController.componentOnReady();
const loading = await loadingController.create({
message: 'Hellooo',
duration: 2000
});
return await loading.present();
}
async function presentLoadingWithOptions() {
const loadingController = document.querySelector('ion-loading-controller');
await loadingController.componentOnReady();
const loading = await loadingController.create({
spinner: 'hide',
duration: 5000,
content: 'Please wait...',
translucent: true,
cssClass: 'custom-class custom-loading'
});
return await loading.present();
}
```