mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
chore(demos): update menu demos
This commit is contained in:
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user