mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
feat(menu): close any opened menu
This commit is contained in:
@@ -37,10 +37,12 @@ class Page2 {
|
||||
templateUrl: 'main.html'
|
||||
})
|
||||
class E2EApp {
|
||||
rootPage;
|
||||
changeDetectionCount: number = 0;
|
||||
pages: Array<{title: string, component: any}>;
|
||||
|
||||
constructor(private app: IonicApp, private menu: MenuController) {
|
||||
this.rootView = Page1;
|
||||
this.changeDetectionCount = 0;
|
||||
this.rootPage = Page1;
|
||||
|
||||
this.pages = [
|
||||
{ title: 'Page 1', component: Page1 },
|
||||
@@ -56,7 +58,7 @@ class E2EApp {
|
||||
nav.setRoot(page.component).then(() => {
|
||||
// wait for the root page to be completely loaded
|
||||
// then close the menu
|
||||
this.menu.close('left');
|
||||
this.menu.close();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -138,6 +138,6 @@
|
||||
|
||||
</ion-menu>
|
||||
|
||||
<ion-nav id="nav" [root]="rootView" #content swipe-back-enabled="false"></ion-nav>
|
||||
<ion-nav id="nav" [root]="rootPage" #content swipe-back-enabled="false"></ion-nav>
|
||||
|
||||
<div [hidden]="isChangeDetecting()"></div>
|
||||
Reference in New Issue
Block a user