I already have this menu toggle button on my pages/home/home.html file:
<ion-header>
<ion-navbar>
<button ion-button menuToggle>
<ion-icon name="menu"></ion-icon>
</button>
<ion-title>Home</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
<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 ion-button secondary menuToggle>Toggle Menu</button>
</ion-content>
I tried your template and works well and helped me to find my mistake.
The ion-nav component must be inside splitpane, just like this:
<ion-split-pane>
<ion-menu [content]="content">
<ion-header>
<ion-toolbar>
<ion-title>Menu</ion-title>
</ion-toolbar>
</ion-header>
<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 MUST BE INSIDE ION SPLIT PANE -->
<ion-nav [root]="rootPage" #content main swipeBackEnabled="false"></ion-nav>
</ion-split-pane>
@ramon and @Jacktoolsnet
Hello! several years later, this solution worked for Ionic v5 with angular v10. It took me too long to find the solution and this answer has been very useful to me.
I changed my to and it works.
Maybe it’s a bit more complex in my case, because I was using the in a tousable component, and the broke my program on the URL. Thank you! and I hope it will serve the community.