Disable sidemenu in specific pages ionic 2 framework

I’m not sure whether its me or it feels for everyone the same that ionic 2 is pretty different from the first one, thus none of those tutorials online are applicable to problems you are sarching for.

Anyway straight to the point I’m going to show you how to disable the side menu (any menu also will work) on specific pages. Lets say in my Case I had a login screen which I did not want the menu to be at.

First thing first is to open your app.html file. where the menu is actually included. Find the opening tag for the menu. So you should be having something like:

Add an id to your menu so it will be something like this:

Alright not we have to make changes to the javascript file of our page. let say my page name is login and the javascript file is called login.js. What you should do is to import “MenuController” from “ionic-angular” package. The NavbarController Should Already be imported, so you can just call in MenuController in the same line like:

now pass menu to your construct function. so it will be like constructor(nav, menu).

Then within the constructor define the menu and disable it by using:

so the final code will look like:

That is it.

Incoming search terms:

  • ionic3 disable bounce android
  • disable slitpane on specific page ionic
  • ionic 2 how to disable and enable side menu
  • ionic 2 login sidemenu
  • ionic 2 side menu 2016
  • ionic disable menu