Files
2015-09-15 14:51:03 -05:00

49 lines
944 B
TypeScript

import {App, IonicApp, IonicView, NavController} from 'ionic/ionic';
@IonicView({templateUrl: 'page1.html'})
class Page1 {}
@IonicView({templateUrl: 'page3.html'})
class Page3 {}
@IonicView({templateUrl: 'page2.html'})
class Page2 {
constructor(nav: NavController) {
this.nav = nav;
}
page3() {
this.nav.push(Page3);
}
}
@App({
templateUrl: 'main.html'
})
class E2EApp {
constructor(app: IonicApp) {
this.app = app;
this.rootView = Page1;
this.pages = [
{ title: 'Page 1', component: Page1 },
{ title: 'Page 2', component: Page2 },
{ title: 'Page 3', component: Page3 },
];
}
openPage(menu, page) {
// close the menu when clicking a link from the menu
menu.close();
// Reset the content nav to have just this page
// we wouldn't want the back button to show in this scenario
let nav = this.app.getComponent('nav');
nav.setRoot(page.component);
}
}