Hiding header


#1

Can I hide header bar in certain views?


#2

Quick and dirty:

Set a variable on the rootScope like $rootScope.hasHeader

Check in your index.html or header template if hasHeader is true

<ion-header-bar ng-if="hasHeader"></ion-header-bar>

And on your ion-content

<ion-content ng-class="{'has-header': hasHeader}">

if you have a header -> ion-header-bar is shown and the content dynamically gets the has-header class.

Greets!


#3

It’s not working. I’t not header as I said it’s ion-nav-bar and it got errors when trying to manipulate nav buttons.


#4

Just use <ion-view hide-nav-bar="true"> in the partial you want to hide the nav bar in.


#5

Great - thanks that works