mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
50 lines
976 B
TypeScript
50 lines
976 B
TypeScript
import {App, IonicApp, Page} from 'ionic/ionic';
|
|
import * as helpers from './helpers';
|
|
|
|
@Page({
|
|
templateUrl: 'menus/menu-home.html'
|
|
})
|
|
class PageOne{
|
|
constructor() {
|
|
}
|
|
}
|
|
|
|
@Page({
|
|
templateUrl: 'menus/menu-friends.html'
|
|
})
|
|
class PageTwo{
|
|
}
|
|
|
|
@Page({
|
|
templateUrl: 'menus/menu-events.html'
|
|
})
|
|
class PageThree{
|
|
}
|
|
|
|
@Page({
|
|
templateUrl: 'menus/menus.html'
|
|
})
|
|
export class MenusPage {
|
|
|
|
constructor(app: IonicApp) {
|
|
this.app = app;
|
|
this.rootPage = PageOne;
|
|
this.pages = [
|
|
{ title: 'Home', component: PageOne },
|
|
{ title: 'Friends', component: PageTwo },
|
|
{ title: 'Events', component: PageThree }
|
|
];
|
|
|
|
}
|
|
|
|
openPage(menu, page) {
|
|
// close the menu when clicking a link from the menu
|
|
this.app.getComponent('leftMenu').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('menuNav');
|
|
nav.setRoot(page.component);
|
|
}
|
|
}
|