Ionic Footer just in some views


#1

Hi!
I am trying to guess how to make that.
I need an Ionic footer that should be the same for the whole app but should be hidden or inactive in some views. My doubt is how to difine it only once and the have it in all my templates/ views.

I am using a SideMenu app.


#2

You can create some var like $scope.showHeader = “none” where you don’t need footer and then add style=“display:{{showHeader}}” to footer.
But it’s a first what I’ve got into my head.


#3

I would not suggest using style=. Instead, use an `ng-if`` for the footer bar.

Something like :

<ion-footer-bar align-title="left" class="bar-assertive" ng-if="showHeader"> // PUT THE NG-IF HERE
  <div class="buttons">
    <button class="button">Left Button</button>
  </div>
  <h1 class="title">Title!</h1>
  <div class="buttons" ng-click="doSomething()">
    <button class="button">Right Button</button>
  </div>
</ion-footer-bar>

#4

Thank you @Calendee. This is a great solution.