How do I change the slide menu header title?


#1

Here’s the generated slidemenu template:

<ion-side-menus>

  <ion-pane ion-side-menu-content>
    <ion-nav-bar class="bar-stable nav-title-slide-ios7">
      <ion-nav-back-button class="button-clear"><i class="icon ion-chevron-left"></i> Back</ion-nav-back-button>
    </ion-nav-bar>
    <ion-nav-view name="menuContent" animation="slide-left-right"></ion-nav-view>
  </ion-pane>

  <ion-side-menu side="left">
    <header class="bar bar-header bar-stable">
      <h1 class="title">Left</h1>
    </header>
    <ion-content class="has-header">
      <ion-list>
        <ion-item nav-clear menu-close href="#/app/search">
          Search
        </ion-item>
        <ion-item nav-clear menu-close href="#/app/browse">
          Browse
        </ion-item>
        <ion-item nav-clear menu-close href="#/app/playlists">
          Playlists
        </ion-item>
      </ion-list>
    </ion-content>
  </ion-side-menu>
</ion-side-menus>

What I’m noticing is that the name of the page is being updated as a header title inside ion-nav-bar. How do I change this behavior so that I can make it whatever I want?

For example say I just wanted never changing text?
How would I add buttons and other things to the header?


#2

Check out this codepen

You can add a title to the nav-bar like so

  <ion-nav-bar class="bar-positive" >
     <h1 class="title">I'll Never Change</h1>
     <ion-nav-back-button class="button-icon ion-arrow-left-c">
     </ion-nav-back-button>
   </ion-nav-bar>

If you remove the titles from the views that get rendered in there, it won’t create a problem.


#3

Thank you the title="" worked perfect!