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

@@ -30,8 +30,6 @@
<ion-button id="backdrop-loading" expand="block" onclick="presentLoadingWithOptions({backdropDismiss: true})">Show Backdrop Click Loading</ion-button>
<ion-button id="html-content-loading" expand="block" onclick="presentLoadingWithOptions({cssClass: 'html-loading', duration: 5000, message: '<ion-button>Click impatiently to load faster</ion-button>'})">Show Loading with HTML content</ion-button>
<ion-loading-controller></ion-loading-controller>
<ion-grid>
<ion-row>
<ion-col size="6">
@@ -64,19 +62,19 @@
</ion-app>
<script>
async function presentLoading() {
const loadingController = document.querySelector('ion-loading-controller');
const loadingElement = await loadingController.create({
function presentLoading() {
const loadingElement = Object.assign(document.createElement('ion-loading'), {
message: 'Hellooo',
duration: 2000
});
return await loadingElement.present();
document.body.appendChild(loadingElement);
return loadingElement.present();
}
async function presentLoadingWithOptions(opts) {
const loadingController = document.querySelector('ion-loading-controller');
const loadingElement = await loadingController.create(opts);
return await loadingElement.present();
function presentLoadingWithOptions(opts) {
const loadingElement = Object.assign(document.createElement('ion-loading'), opts);
document.body.appendChild(loadingElement);
return loadingElement.present();
}
</script>

View File

@@ -18,8 +18,6 @@
<button id="translucent-loading" onclick="presentLoadingWithOptions({duration: 5000, content: 'Loading Please Wait...', translucent: true})">Show Loading with translucent</button>
<button id="custom-class-loading" onclick="presentLoadingWithOptions({duration: 5000, content: 'Loading Please Wait...', translucent: true, cssClass: 'custom-class custom-loading'})">Show Loading with cssClass</button>
<ion-loading-controller></ion-loading-controller>
<style>
body > button {
display: block;
@@ -36,18 +34,18 @@
<script>
async function presentLoading() {
const loadingController = document.querySelector('ion-loading-controller');
const loadingElement = await loadingController.create({
const loadingElement = Object.assign(document.createElement('ion-loading'), {
message: 'Hellooo',
duration: 5000
});
return await loadingElement.present();
document.body.appendChild(loadingElement);
return loadingElement.present();
}
async function presentLoadingWithOptions(opts) {
const loadingController = document.querySelector('ion-loading-controller');
const loadingElement = await loadingController.create(opts);
return await loadingElement.present();
function presentLoadingWithOptions(opts) {
const loadingElement = Object.assign(document.createElement('ion-loading'), opts);
document.body.appendChild(loadingElement);
return loadingElement.present();
}
</script>
</body>