Use of Persistent menu


What is the use of Persistent menu, i went through the API guide but didn’t understood it properly.

In my ionic 2 project i am writing the code for the menu on every page as:

<ion-menu  [content]="mycontent" >
  <ion-content primary>
    <ion-item-divider><center> Menu </center></ion-item-divider>
      <button ion-item menuClose clear primary block medium (click)="gotosettings()" ><ion-icon name="calendar"></ion-icon>Settings</button>
      <button ion-item menuClose clear primary block medium (click)=" gotoabout()"><ion-icon name="calendar"></ion-icon>About Us</button>

<ion-nav #mycontent [root]="rootPage"></ion-nav>

but the menu is always opening in the page1 view (when i am clicking the menuToggle button in page 2 the menu will get open in page 1 only).

can i use persistent menus to solve this ?


So think of it like this.

You’re on page 1, and there’s a sidemenu that you can open to go to new pages.

Now from page 1, you push a new page, Page2 on the stack.

A common convention in mobile is that the sidemenu should be disabled, and a back button should be displayed so that you can navigate back. So by default, this is what we do.

A persistent menu will not do this. From page1 => page2, you will be able to open the sidemenu


Thanks Sir…!! :slight_smile: