Hiding header

Can I hide header bar in certain views?

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!

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.

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

Great - thanks that works

1 Like