How to close Menu in Ionic 4

Asked by At

I have just started ionic 4 and now i am searching a basic question,How to Close Menu in Ionic 4. ionic 4 has not properly documented till now. kindly anyone ans me.thanks in advance.

1 Answers

0
Amit Pandey On

To close the Menu use this

Use menuCtrl in ts file in ionic 4

import { MenuController } from ‘@ionic/angular’; 

...

constructor(private menu: MenuController) {}

//call this fn on click

openEnd() {  
 this.menu.close();

 }

OR in Html use ion-menu-toggle

<ion-menu-toggle>
<ion-item > My Button </ion-item>
</ion-menu-toggle>