Ionic 2 - global NavBar (<ion-nav-bar>


#1

In Ionic 1, we have the ability to define an <ion-nav-bar> above an <ion-nav-view>, which serves as a generic nav bar for the entire app and we could turn it off on a per-view basis (using ionNavView's hideNavBar=true|false.

It appears in Ionic 2 we have to insert an <ion-nav-bar> per page - and cannot have a global nav bar for the entire app. Is that correct, or am I missing a trick?


#2

This is correct. We made this change because people wanted more granular control of the navBar and the V1 version just provide that. So now with V2 we can have a reliable way to change a navBar’s color on the fly, and make sure all the navbars content updates/animates correctly.


#3

Awesome - thanks for confirming. :slight_smile:


#4

Is there a way we can define a global navbar so that we won’t repeat navbar’s functions on each page ? would implementing it in its own component the right way to go ?

Thanks


#5

This is not possible. The navbar is not setup this way.