Files
Brandy Carney dae37e7d9c feat(loading): add ability to hide spinner in the config or options
tweak css to add a max width to the loading indicator

references #5426
2016-04-01 13:13:43 -04:00

128 lines
2.4 KiB
TypeScript

import {App, Page, ActionSheet, Loading, NavController, ViewController, Platform} from 'ionic-angular';
@Page({
templateUrl: 'main.html'
})
class E2EPage {
constructor(private nav: NavController, private platform: Platform) {}
presentLoadingIos() {
let loading = Loading.create({
spinner: 'ios',
enableBackdropDismiss: true
});
this.nav.present(loading);
}
presentLoadingDots() {
let loading = Loading.create({
spinner: 'dots',
content: 'Loading...',
enableBackdropDismiss: true
});
this.nav.present(loading);
}
presentLoadingBubbles() {
let loading = Loading.create({
spinner: 'bubbles',
content: 'Loading...',
enableBackdropDismiss: true
});
this.nav.present(loading);
}
presentLoadingCircles() {
let loading = Loading.create({
spinner: 'circles',
content: 'Loading...',
enableBackdropDismiss: true
});
this.nav.present(loading);
}
presentLoadingCrescent() {
let loading = Loading.create({
spinner: 'crescent',
content: 'Please wait...',
enableBackdropDismiss: true,
duration: 1500
});
this.nav.present(loading);
}
presentLoadingDefault() {
let loading = Loading.create({
content: 'Please wait...',
enableBackdropDismiss: true,
});
this.nav.present(loading);
setTimeout(() => {
loading.dismiss();
}, 5000);
}
presentLoadingCustom() {
let loading = Loading.create({
spinner: 'hide',
content: `
<div class="custom-spinner-container">
<div class="custom-spinner-box"></div>
</div>`,
enableBackdropDismiss: true
});
this.nav.present(loading);
}
presentLoadingText() {
let loading = Loading.create({
spinner: 'hide',
content: 'Loading Please Wait...'
});
this.nav.present(loading);
setTimeout(() => {
this.goToPage2();
}, 1000);
setTimeout(() => {
loading.dismiss();
}, 5000);
}
goToPage2() {
this.nav.push(Page2);
}
}
@Page({
template: `
<ion-navbar *navbar>
<ion-title>Page 2</ion-title>
</ion-navbar>
<ion-content padding>Some content</ion-content>
`
})
class Page2 {
constructor(private nav: NavController, private platform: Platform) {}
}
@App({
template: '<ion-nav [root]="root"></ion-nav>'
})
class E2EApp {
root = E2EPage;
}
document.body.innerHTML += '<link href="styles.css" rel="stylesheet">'