From 17f1474527a72122b5e8268b019ac6d54c53760f Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Fri, 30 Oct 2015 16:30:27 -0500 Subject: [PATCH] test(nav): nested navs wip --- ionic/components/nav/test/nested/index.ts | 108 ++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 ionic/components/nav/test/nested/index.ts 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; + } +}