From e8f1b164d614a0e367b8127c878f8ce9dd62b101 Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Thu, 4 Feb 2016 20:42:12 -0600 Subject: [PATCH] chore(demos): update menu demos --- demos/id/index.ts | 17 ++++++++--------- demos/menu/index.ts | 17 ++++++++--------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/demos/id/index.ts b/demos/id/index.ts index 53ec8f76d6..29e82fc363 100644 --- a/demos/id/index.ts +++ b/demos/id/index.ts @@ -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; } } diff --git a/demos/menu/index.ts b/demos/menu/index.ts index 53ec8f76d6..29e82fc363 100644 --- a/demos/menu/index.ts +++ b/demos/menu/index.ts @@ -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; } }