Navigation and side menu


#1

I am beggining with ionic so help would really be nice!

When using a side menu, if the user goes to a “root” page, how on this root page display a navbar that contains a back button?

because it’s easier with codepen I wrote an exemple of what I would like to achieve:

when the user goes to “other” I would like to have a nav bar with the title of the page and a back button (to go back to the previous page).
How should I do that? (I do not want “other” to be a “child” of the side menu… because it’s really a completely different page…)

thanks in advance


Menu-close
#2

Fork this Codepen: http://plnkr.co/edit/pGwucVrTBDxSvw6z092h?p=preview

And, see how you go…


#3

hi.
thanks for the answer but it really has nothing to do with what I want to do… (it’s just the ionic menu template…)

in my case as I said I do not want for exemple “search” to be a child of “app”. but I still want that on the search page there is a back button…


#4
  1. It’s a correctly functioning version of the Ionic side menu template, to get you started.

  2. It uses Ionic v1.0.0 because Ionic v1.0.1 has a ‘< Back’ button bug (https://github.com/driftyco/ionic/issues/4132)


#5

hi.
thanks again for you reply.
I created a fork of what you gave:

but when I go to “other” there is still no back button available…
I do not really understand why…


#6

ui-router and the Ionic directives provide specific functionality so you can only make them work the way they work and not the way you might like them to work.

So, you need to read the docs and then write some code and learn as you go…

Check out the links at the bottom of this post: http://robferguson.org/2015/07/19/using-ui-router-for-handling-routes-defining-states-and-sharing-data-between-views/


#7

Thanks again. I read a lot of documentation.
but in the exemple you gave me everything is in fact in the “menucontent”. which is not what I want.

One more question:
if I have
PARENT STATE
–> CHILD STATE
(parent state contains a “ion-nav-view” in which CHILD STATE will be inserted)
none of the state are abstract.
if I am at PARENT STATE and whith a button I manage to go to CHILD STATE.
the child is displayed.
THEN when I push the back button, why is the “child” still displayed?)