Hide header and nav bar for some pages


#1

I want to hide header and navbar for some pages like the login screen. But once logged in I want to be able to have the navbar and header enabled? I tried something like this and for some reason it doesn’t seem to work.

Ionic version 1.0.0.beta1

Here is the codepen link.


#2

What I do is set

 $rootScope.hide_header = true 

in the controller for pages I want to hide the header for, then my header code uses ng-if

<header class="bar bar-header bar-positive" ng-if="!hide_header">

I make sure to call

$rootScope.hide_header = false

With any functions to leave the page, though have been toying with the idea of doing it in ui-router

  $rootScope.$on '$stateChangeSuccess', (event, current, previous ) ->
     $rootScope.hide_header = false

Good luck!
Kevin


#3

Awesome that works now!