I created a menu in app.html and I’ve setup a menu toggle button in my home page to open and close this menu. But the problem is, no matter what page I’m on, If I slide my screen to the right, the menu shows up ! My menu should only be accessible in my home page through the menu toggle button : how do I achieve this ? ( my persistent is set to false, by the way )
Hmmm. Try to move your menu from app.html to home.html.
Unfortunately, according to the ionic documentation, all menus have to be part of app.html to work. You can’t put it in a specific page
Realy. I should read the dokumentation better. I put my menu always in home.html.
Whoa how did you do that ? Your menu works ?
Lovely app ! May I see just the code for how you implemented your menu ?
<ion-header>
<ion-navbar color="primary">
<button ion-button menuToggle>
<ion-icon name='menu'></ion-icon>
</button>
<ion-title>
WeeklyStyle
</ion-title>
<ion-nav id="nav" main #mymenucontent [root]="rootPage"></ion-nav>
</ion-navbar>
</ion-header>
<ion-menu type="overlay" [content]="mymenucontent">
<ion-content class="menu-gradient">
<div class="spacer" style="width: 254px; height: 10px;"></div>
<div class="category-image">
<img src="assets/img/weeklyStyle/category.png" style="display: block; width: 60%; height: auto; margin-left: auto; margin-right: auto;">
</div>
<!--h3 id="menu-heading1" style="color: rgb(255, 255, 255); font-weight: 400; text-align: center;">{{categoryString}}</h3-->
<div class="spacer" style="width: 254px; height: 5px;"></div>
<ion-list>
<button ion-item (click)="goToPageLookOverview()" class="menu-item" menu-close="" active-page-highlight="">
Looks
</button>
....
</ion-list>
</ion-content>
</ion-menu>
<ion-content padding>
.....
The problem is in my app, the menu isn’t in the root page so I can’t implement it your way
And if you try
[root] = "yourPageWithMenu"
The design of my app requires that the root page be main app’s home page and not the page with the menu. So I guess I need to figure out another way to do this
Try to enable it with the menu controler where you don’t need it.
this.menuCtrl.enable(false, 'mainmenu');