Dynamic button to static header


#1

Hello everyone! I have a template which look like this:

<ion-side-menus id="side-menus" enable-menu-with-back-views="true">

    <ion-side-menu-content nav-router animation="slide-left-right">
        <ion-header-bar class="bar-positive">
            <button menu-toggle="left" class="button button-icon icon ion-navicon"></button>
            <img src="logo.png" id="logo">
        </ion-header-bar>
        <ion-nav-view name="center"></ion-nav-view>
    </ion-side-menu-content>

    <ion-side-menu side="left" id="side-menu-left-content">
        <ion-nav-view name="left"></ion-nav-view>
    </ion-side-menu>
</ion-side-menus>

eveything works fine, but i need to add one more button to header(ion-header-bar) on certain pages, is there any way to do it? Thanks.


#2

use ion-nav-bar instead of headerbar.

then you can set the content of that bar in each view if you want:
http://ionicframework.com/docs/api/directive/ionNavButtons/


#3

Okay, but how to replace page title with some image? Also Its not good becouse i must put the same code on every template, i mean side-menu’s button.