I’m having a problem with the upgrade to beta11 and sidemenu.
I’m declaring the menu template in a different file, not in app.html, that seems to be the problem, but it works in beta 10.
The first time I click in the burger menu, it opens the menu correctly, but when I select an option on it, it navigates correctly but the menu never works again. Although you still see the menu, it doesn’t work.
I’m almost certain that the problem comes from the <ion-nav>
. I need this tag in app.html for declaring the rootpage:
<ion-nav [root]="rootPage" ></ion-nav>
But I also need this when declaring the menu template:
<ion-nav id="nav" #content [root]="rootPage"></ion-nav>
I think both are incompatible or something like this with the latest changes in this update, but how it could be done in beta11?
This is my code:
app.html
<ion-nav [root]="rootPage" ></ion-nav>
menu.html
<ion-menu id = "menu" [content]="content">
<ion-toolbar>
<ion-title>Menu</ion-title>
</ion-toolbar>
<ion-content>
<ion-list>
<button menuClose ion-item *ngFor="let p of pages" (click)="openPage(p)">
{{p.title}}
</button>
</ion-list>
</ion-content>
</ion-menu>
<ion-nav id="nav" #content [root]="rootPage"></ion-nav>
Page1.html
<burguer-menu></burguer-menu>
<ion-header>
<ion-navbar>
<button menuToggle>
<ion-icon name="menu"></ion-icon>
</button>
<ion-title>Page Uno</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding class="page1">
<h3>Ionic Menu Starter</h3>
<p>
If you get lost, the <a href="http://ionicframework.com/docs/v2">docs</a> will show you the way.
</p>
<button secondary menuToggle>Toggle Menu</button>
</ion-content>
When I navigate with openPage§ in menu.ts I do it this way:
openPage(page) {
this.nav.setRoot(page.component);
}
I have isolated the problem in a Github project for further reference:
https://github.com/bokgeek/Ionic2-Side-Menu
This is a gif explaining the situation:
Many thanks in advance!