Change default "Back" text on <ion-back-button>

Hello everyone!

When there’s no enough space available in the header, ionic automatically puts the default text as "Back"
I was wondering how can I change this text to "Go Back"for example, but not something like this:

<ion-nav-buttons side="left">
    <button class="button back-button buttons button-clear header-item">
        Go Back
    </button>
</ion-nav-buttons>

Instead, I’d like to this button appear ONLY if there’s not enough space (just like ionic does by default).

Basically I’m trying to change Back to Go Back (or whatever).

Thanks! :smile:

Hello, is it me you’re looking for?

Have you tried the ionNavBackButton? or the $ionicConfigProvider which has a method to set the text for the back button?

1 Like

i tried to change text with ionicconfig but icon alone changing text is still coming the same

Hey @joseadrian thanks a lot!

I read the docs for $ionicConfigProvider as you mentioned and I wrote this line in my app.js:

        $ionicConfigProvider.backButton.text("Whatever");

It’s working great :smile:

@rajmp, I don’t know if I understood correctly could you explain what are you trying to achieve?

Problem solved: