Derek Ault
Derek Ault

Reputation: 11

Ionic navbar button on just one page?

I only need a button on the right side of the navbar on one page, what would be the best way to do this?

I have tried:

<ion-nav-bar>
</ion-nav-bar>
<ion-nav-view>
  <ion-view>
    <ion-nav-buttons side="primary">
      <button class="button" ng-click="doSomething()">
        I'm a button on the primary of the navbar!
      </button>
    </ion-nav-buttons>
    <ion-content>
      Some super content here!
    </ion-content>
  </ion-view>
</ion-nav-view>

But this doesn't display anything on the navbar

Upvotes: 0

Views: 271

Answers (1)

Derek Ault
Derek Ault

Reputation: 11

I got it working. On the page that you want the icon you need

<ion-view view-title="Test Page">
    <ion-nav-buttons side="right">
        <button class="button button-icon button-clear ion-email">
        </button>
    </ion-nav-buttons>

    <ion-content>
    </ion-content>
</ion-view>

Upvotes: 1

Related Questions