Disable Ion menu in login in Ionic4

I tried to disable menu while swipe the screen in login screen .

Hello, You can do something like this…

Import MenuController in your login.page.ts file

import { MenuController } from '@ionic/angular';

add this line in constructor

  constructor(private menu: MenuController) { 
    this.menu.enable(false, 'custom');
  }

here “custom” is id

after this open app.component.html

add id in ion-menu: menuId=“custom”

<ion-app>
  <ion-split-pane>
    <ion-menu type="overlay" menuId="custom">
      <ion-content>
        <ion-list>
          <ion-menu-toggle auto-hide="false" *ngFor="let p of appPages">
            <ion-item [routerDirection]="'root'" [routerLink]="[p.url]" lines="full">
              <ion-icon slot="start" [name]="p.icon" color="light"></ion-icon>
              <ion-label color="light">
                {{p.title}}
              </ion-label>
            </ion-item>
          </ion-menu-toggle>
        </ion-list>
      </ion-content>
    </ion-menu>
    <ion-router-outlet main></ion-router-outlet>
  </ion-split-pane>
</ion-app>

Hope it help you :slight_smile:

1 Like

Thank you @gokujy its working :+1::+1:

1 Like