mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-21 13:01:01 +08:00
49 lines
852 B
TypeScript
49 lines
852 B
TypeScript
import { Component, NgModule } from '@angular/core';
|
|
|
|
import { IonicModule, MenuController } from 'ionic-angular';
|
|
|
|
|
|
@Component({
|
|
templateUrl: 'main.html'
|
|
})
|
|
export class ApiDemoPage {
|
|
activeMenu: string;
|
|
|
|
constructor(public menu: MenuController) {
|
|
this.menu1Active();
|
|
}
|
|
menu1Active() {
|
|
this.activeMenu = 'menu1';
|
|
this.menu.enable(true, 'menu1');
|
|
this.menu.enable(false, 'menu2');
|
|
}
|
|
menu2Active() {
|
|
this.activeMenu = 'menu2';
|
|
this.menu.enable(false, 'menu1');
|
|
this.menu.enable(true, 'menu2');
|
|
}
|
|
}
|
|
|
|
|
|
@Component({
|
|
templateUrl: 'app.html'
|
|
})
|
|
export class ApiDemoApp {
|
|
root = ApiDemoPage;
|
|
}
|
|
|
|
@NgModule({
|
|
declarations: [
|
|
ApiDemoApp,
|
|
ApiDemoPage
|
|
],
|
|
imports: [
|
|
IonicModule.forRoot(ApiDemoApp)
|
|
],
|
|
bootstrap: [IonicApp],
|
|
entryComponents: [
|
|
ApiDemoPage
|
|
]
|
|
})
|
|
export class AppModule {}
|