import {App, NavController} from 'ionic/ionic';
import {Page, Config, IonicApp} from 'ionic/ionic';
import {NavParams, NavController, ViewController} from 'ionic/ionic';
@Page({
template: `
Login
`
})
export class Login {
constructor(nav: NavController) {
this.nav = nav;
}
goToAccount() {
this.nav.push(Account);
}
}
@Page({
template: `
Account Menu
`
})
export class Account {
constructor(app: IonicApp) {
this.app = app;
this.rootPage = Dashboard;
}
goToProfile() {
this.app.getComponent('account-nav').setRoot(Profile).then(() => {
this.app.getComponent('menu').close();
});
}
goToDashboard() {
this.app.getComponent('account-nav').setRoot(Dashboard).then(() => {
this.app.getComponent('menu').close();
});
}
logOut() {
this.app.getComponent('root-nav').setRoot(Login, null, { animate: true });
}
}
@Page({
template: `
Account Dashboard
`
})
export class Dashboard {
constructor(app: IonicApp, nav: NavController) {
this.app = app;
this.nav = nav;
}
goToProfile() {
this.nav.push(Profile);
}
logOut() {
this.app.getComponent('root-nav').setRoot(Login, null, {
animate: true,
direction: 'back'
});
}
}
@Page({
template: `
Account Profile
`
})
export class Profile {
constructor(app: IonicApp, nav: NavController) {
this.app = app;
this.nav = nav;
}
goToDashboard() {
this.nav.push(Dashboard);
}
logOut() {
this.app.getComponent('root-nav').setRoot(Login, null, {
animate: true,
direction: 'back'
});
}
}
@App({
template: ``
})
class E2EApp {
constructor() {
this.rootPage = Login;
}
}