chore(demos): update menu demos

This commit is contained in:
Adam Bradley
2016-02-04 20:42:12 -06:00
parent fc49d1aa29
commit e8f1b164d6
2 changed files with 16 additions and 18 deletions

View File

@ -1,20 +1,20 @@
import {App, IonicApp, Page} from 'ionic/ionic';
import {App, Page, MenuController} from 'ionic/ionic';
@Page({templateUrl: 'page1.html'})
class Page1 {
constructor(app: IonicApp) {
this.app = app;
constructor(menu: MenuController) {
this.menu = menu;
this.menu1Active();
}
menu1Active() {
this.activeMenu = 'menu1';
this.app.getComponent('menu1').enable(true);
this.app.getComponent('menu2').enable(false);
this.menu.enable(true, 'menu1');
this.menu.enable(false, 'menu2');
}
menu2Active() {
this.activeMenu = 'menu2';
this.app.getComponent('menu1').enable(false);
this.app.getComponent('menu2').enable(true);
this.menu.enable(false, 'menu1');
this.menu.enable(true, 'menu2');
}
}
@ -22,8 +22,7 @@ class Page1 {
templateUrl: 'main.html'
})
class ApiDemoApp {
constructor(app: IonicApp) {
this.app = app;
constructor() {
this.rootView = Page1;
}
}

View File

@ -1,20 +1,20 @@
import {App, IonicApp, Page} from 'ionic/ionic';
import {App, Page, MenuController} from 'ionic/ionic';
@Page({templateUrl: 'page1.html'})
class Page1 {
constructor(app: IonicApp) {
this.app = app;
constructor(menu: MenuController) {
this.menu = menu;
this.menu1Active();
}
menu1Active() {
this.activeMenu = 'menu1';
this.app.getComponent('menu1').enable(true);
this.app.getComponent('menu2').enable(false);
this.menu.enable(true, 'menu1');
this.menu.enable(false, 'menu2');
}
menu2Active() {
this.activeMenu = 'menu2';
this.app.getComponent('menu1').enable(false);
this.app.getComponent('menu2').enable(true);
this.menu.enable(false, 'menu1');
this.menu.enable(true, 'menu2');
}
}
@ -22,8 +22,7 @@ class Page1 {
templateUrl: 'main.html'
})
class ApiDemoApp {
constructor(app: IonicApp) {
this.app = app;
constructor() {
this.rootView = Page1;
}
}