Can I Custom Nav-bar back-button

Hi,
I am new to angularjs and ionic and I got a question.
Have a look at this template https://github.com/driftyco/ionic-starter-sidemenu

I’d like to use back button but I would like to change the link that it refers to.
In other words
I need to go to specific page when I click this button and don’t want to go to last page !!

Is there any way to do that ?

Thanks :slight_smile:

sure you can could do this:

<ion-nav-buttons side="left">
   <button class="button" ng-click="doSomething()">
      I'm a button on the left of the navbar!
   </button>
 </ion-nav-buttons>

and in your controller create the methode doSomething and there you could use $state.go
or you could use ui-sref=“state” or href=“link to page”

http://ionicframework.com/docs/api/directive/ionNavButtons/

1 Like

Thank you very much @Auro

But in my app I have just one back button in the menu.html as this:

<ion-nav-back-button class="button-clear"><i class="icon ion-ios7-arrow-back BackButton"></i></ion-nav-back-button>

and all other html files don’t contain this button !!
and I have a large number of pages, each one i need its back button to refer to different page

In other words: Page that refers her this button varies each time (depending on the current page)

I apologize to my poor drafting, but English is not my native

if you dont need the backbutton
then remove it there!

you can add this button on every site you want just put it inside ion-view

like this:

<ion-view>
   <ion-nav-buttons side="left">
        <a class="button button-icon icon ion-ios7-arrow-back" href="#/tab/setting"></a>
    </ion-nav-buttons>
    <ion-content>
       ...
    </ion-content>
</ion-view>
1 Like

Thanks again @Auro
you helped me alot :slight_smile: