I would like to change the color of the ion-nav-bar to a different color depending on the state of the app.
I considered using a scope variable in the class, like: <ion-nav-bar class="bar-positive nav-title-slide-ios7 {{NavBarColor}}"> and passing a variable from the controller, but since ion-nav-bar is in index.html and not a partial, it won’t register. Anybody know of a way around this?
Hey @pbernasconi, thanks. Unfortunately this means I have to tie a separate controller to ion-nav-bar since ion-nav-bar is in index.html and not in a partial. I’m looking for a way to set the color of the nav bar on a per state basis. Do you know of a way to do that?
I’m checking with the Ionic devs on this. See what kind of ideas we can come up with. I’m thinking it might be good to have $ionicNavBarDelegate have a public method to change the bar color.
I created a directive and used the states names as part of a class. Then on the styles, the background is applied to the bar using those custom classes based on the states.