Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ionic navbar buttons - right side

I'm starting to use Ionic for the first time. Currently I have a listview and the back button appears when moving into the list.

<ion-nav-bar class="bar-stable nav-title-slide-ios7">
  <ion-nav-back-button class="button-icon icon  ion-ios7-arrow-back">
    Back
  </ion-nav-back-button>
</ion-nav-bar>

How do I add a button on the right of the screen now, also only appearing once moving into the list?

like image 416
Harry Avatar asked Aug 08 '14 12:08

Harry


2 Answers

<ion-nav-buttons> is what you're looking for: link

This took me a long time to find, but it works just great. Just put side="right" as the attribute.

It would be nice if this was more apparent in the docs.

like image 75
dk123 Avatar answered Sep 19 '22 18:09

dk123


This is what I ended up doing:

<ion-nav-bar class="bar-stable nav-title-slide-ios7">
    <ion-nav-back-button class="button-icon icon  ion-ios7-arrow-back">
        Back
    </ion-nav-back-button>
    <ion-nav-buttons side="right">
        <button class="button button-clear button-positive" ng-click="reset()">
            Refresh
        </button>
    </ion-nav-buttons>
</ion-nav-bar>
like image 41
Harry Avatar answered Sep 20 '22 18:09

Harry