mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 04:14:21 +08:00
chore(e2e): rename app-module.ts to app.module.ts for consistency
references #10023
This commit is contained in:
71
src/components/menu/test/enable-disable/app.module.ts
Normal file
71
src/components/menu/test/enable-disable/app.module.ts
Normal file
@ -0,0 +1,71 @@
|
||||
import { Component, ViewChild, NgModule } from '@angular/core';
|
||||
import { IonicApp, IonicModule, App, MenuController, Nav } from '../../../..';
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page1.html'
|
||||
})
|
||||
export class Page1 {
|
||||
}
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page2.html'
|
||||
})
|
||||
export class Page2 {
|
||||
}
|
||||
|
||||
|
||||
@Component({
|
||||
templateUrl: 'main.html'
|
||||
})
|
||||
export class E2EApp {
|
||||
@ViewChild(Nav) nav: Nav;
|
||||
|
||||
activeMenu: string;
|
||||
page1 = Page1;
|
||||
page2 = Page2;
|
||||
rootPage = Page1;
|
||||
|
||||
constructor(public app: App, public menuCtrl: MenuController) {
|
||||
this.menu1Active();
|
||||
}
|
||||
|
||||
openPage(p: any) {
|
||||
// Get the <ion-nav> by id
|
||||
this.nav.setRoot(p);
|
||||
}
|
||||
|
||||
menu1Active() {
|
||||
this.menuCtrl.enable(true, 'menu1');
|
||||
this.menuCtrl.enable(false, 'menu2');
|
||||
this.menuCtrl.enable(false, 'menu3');
|
||||
}
|
||||
menu2Active() {
|
||||
this.menuCtrl.enable(false, 'menu1');
|
||||
this.menuCtrl.enable(true, 'menu2');
|
||||
this.menuCtrl.enable(false, 'menu3');
|
||||
}
|
||||
menu3Active() {
|
||||
this.menuCtrl.enable(false, 'menu1');
|
||||
this.menuCtrl.enable(false, 'menu2');
|
||||
this.menuCtrl.enable(true, 'menu3');
|
||||
}
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
E2EApp,
|
||||
Page1,
|
||||
Page2
|
||||
],
|
||||
imports: [
|
||||
IonicModule.forRoot(E2EApp)
|
||||
],
|
||||
bootstrap: [IonicApp],
|
||||
entryComponents: [
|
||||
E2EApp,
|
||||
Page1,
|
||||
Page2
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
Reference in New Issue
Block a user