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-menu type="overlay" menuId="custom">
          <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">
    <ion-router-outlet main></ion-router-outlet>

Hope it help you :slight_smile:


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

1 Like