diff --git a/ionic/components/nav/test/nested/index.ts b/ionic/components/nav/test/nested/index.ts new file mode 100644 index 0000000000..ad14126e51 --- /dev/null +++ b/ionic/components/nav/test/nested/index.ts @@ -0,0 +1,108 @@ +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); + } +} + + +@Page({ + template: ` + + Account Dashboard + + + Dashboard + + ` +}) +export class Dashboard {} + + +@Page({ + template: ` + + Account Profile + + + Profile + + ` +}) +export class Profile {} + + +@App({ + template: `` +}) +class E2EApp { + constructor() { + this.rootPage = Login; + } +}