How to show back button when access page from ion-list in sidemenu


#1

I’m so confuse. How to show back button when i access login page from sidemenu, and back to playlist?When login page open,always show icon menu,and not back button.



#2

okay this is how navigation and sidemenu in ionic works:

  1. Think of the sidemenu as a global thing
  2. By default every item in the sidemenu should change the context --> if you change the context, you need no backbutton, because you can simply go again over the sidemenu to another context
  3. A Backbutton is used, if you are navigating on a specific path deeper and depper. Like from a list view to a detail page
  4. And Login and Playlist has nothing to do with each others.

And now to the programming things.

If you have the “menu-close” directive on your list-items in the sidemenu --> it will reset history, close the menu and disable the animation for the next state-transition by click.

But maybe you should consider ui changes to not confuse your users.

If you want to access the login from everywhere you could add a popover to the headerbar. Or you add a button to the headerbar and then the login form opens in a modal or popup.

But only keep in mind: Sidemenu items should change the context. You are not navigating deeper. So there is per default not back-button.

You could remove the menu-close directive and add something own. But if you only remove it, you will get some navigation problems:

Think about when every change of the context in the sidemenu does not reset history --> you could create navigation circles like “Login --> Playlist --> Playlist item --> Login --> Playlist”. :wink:


#3

thank you sir. i will think about it.