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'}) @Page({templateUrl: 'page1.html'})
class Page1 { class Page1 {
constructor(app: IonicApp) { constructor(menu: MenuController) {
this.app = app; this.menu = menu;
this.menu1Active(); this.menu1Active();
} }
menu1Active() { menu1Active() {
this.activeMenu = 'menu1'; this.activeMenu = 'menu1';
this.app.getComponent('menu1').enable(true); this.menu.enable(true, 'menu1');
this.app.getComponent('menu2').enable(false); this.menu.enable(false, 'menu2');
} }
menu2Active() { menu2Active() {
this.activeMenu = 'menu2'; this.activeMenu = 'menu2';
this.app.getComponent('menu1').enable(false); this.menu.enable(false, 'menu1');
this.app.getComponent('menu2').enable(true); this.menu.enable(true, 'menu2');
} }
} }
@ -22,8 +22,7 @@ class Page1 {
templateUrl: 'main.html' templateUrl: 'main.html'
}) })
class ApiDemoApp { class ApiDemoApp {
constructor(app: IonicApp) { constructor() {
this.app = app;
this.rootView = Page1; 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'}) @Page({templateUrl: 'page1.html'})
class Page1 { class Page1 {
constructor(app: IonicApp) { constructor(menu: MenuController) {
this.app = app; this.menu = menu;
this.menu1Active(); this.menu1Active();
} }
menu1Active() { menu1Active() {
this.activeMenu = 'menu1'; this.activeMenu = 'menu1';
this.app.getComponent('menu1').enable(true); this.menu.enable(true, 'menu1');
this.app.getComponent('menu2').enable(false); this.menu.enable(false, 'menu2');
} }
menu2Active() { menu2Active() {
this.activeMenu = 'menu2'; this.activeMenu = 'menu2';
this.app.getComponent('menu1').enable(false); this.menu.enable(false, 'menu1');
this.app.getComponent('menu2').enable(true); this.menu.enable(true, 'menu2');
} }
} }
@ -22,8 +22,7 @@ class Page1 {
templateUrl: 'main.html' templateUrl: 'main.html'
}) })
class ApiDemoApp { class ApiDemoApp {
constructor(app: IonicApp) { constructor() {
this.app = app;
this.rootView = Page1; this.rootView = Page1;
} }
} }