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', duration: 2000 }); this.nav.present(loading); } presentLoadingDots() { let loading = Loading.create({ spinner: 'dots', content: 'Loading...', duration: 2000 }); this.nav.present(loading); } presentLoadingBubbles() { let loading = Loading.create({ spinner: 'bubbles', content: 'Loading...', duration: 2000 }); this.nav.present(loading); } presentLoadingCircles() { let loading = Loading.create({ spinner: 'circles', content: 'Loading...', duration: 2000 }); this.nav.present(loading); } presentLoadingCrescent() { let loading = Loading.create({ spinner: 'crescent', content: 'Please wait...', duration: 1500 }); this.nav.present(loading); } presentLoadingDefault() { let loading = Loading.create({ content: 'Please wait...', }); this.nav.present(loading); setTimeout(() => { loading.dismiss(); }, 5000); } presentLoadingCustom() { let loading = Loading.create({ spinner: 'hide', content: `
`, duration: 2000 }); this.nav.present(loading); } presentLoadingText() { let loading = Loading.create({ spinner: 'hide', content: 'Loading Please Wait...' }); this.nav.present(loading); setTimeout(() => { this.nav.push(Page2); }, 1000); setTimeout(() => { loading.dismiss(); }, 5000); } goToPage2() { this.nav.push(Page2); } } @Page({ template: ` Page 2 Some content ` }) class Page2 { constructor(private nav: NavController, private platform: Platform) {} onPageLoaded() { setTimeout(() => { this.nav.push(Page3); }, 1000); } goToPage3() { this.nav.push(Page3); } } @Page({ template: ` Page 3 Some content ` }) class Page3 { constructor(private nav: NavController, private platform: Platform) {} } @App({ template: '' }) class E2EApp { root = E2EPage; } document.body.innerHTML += ''