How to disable side menu are some pages

I found some solution

So that this,

<ion-menu [content]="content">
Becomes this.

<ion-menu id="myMenu" [content]="content">

and after
Openlogin.ts and import theMenuController from ionic/angular.

The following worked for me on Ionic2 v.2.2.0

Open src/app/app.html and add an ID to your element
So that this,

<ion-menu [content]=“content”>
Becomes this.

<ion-menu id=“myMenu” [content]=“content”>
Open login.html and remove the code from so that the menu will not display on the page.
Open login.ts and import the MenuController from ionic/angular.
In the constructor set enable() on MenuCtrl to false and add the menu ID as the second parameter. Even though the menu isn’t showing, doing this will prevent the user from swiping to open the menu.

 constructor(
    public navCtrl: NavController,
    public menuCtrl: MenuController
  ) {
    this.menuCtrl.enable(false, 'myMenu');
  }
12 Likes