import { Component} from '@angular/core';
import { ionicBootstrap, NavController } from '../../../../../src';
let delay = 100;
let animate = false;
let count = 0;
@Component({
template: `
Page 1
`
})
class Page1 {
tmr: number;
constructor(private nav: NavController) {}
play() {
this.tmr = setTimeout(() => {
count++;
console.log('push', count);
this.nav.push(Page2, null, {
animate: animate
});
}, delay);
}
ionViewDidEnter() {
this.play();
}
stop() {
clearTimeout(this.tmr);
}
}
@Component({
template: `
Page 2
`
})
class Page2 {
tmr: number;
constructor(private nav: NavController) {}
play() {
this.tmr = setTimeout(() => {
count++;
console.log('pop', count);
this.nav.pop({
animate: animate
});
}, delay);
}
ionViewDidEnter() {
this.play();
}
stop() {
clearTimeout(this.tmr);
}
}
@Component({
template: ``
})
class E2EApp {
root = Page1;
}
ionicBootstrap(E2EApp);