With the code:
<ion-navbar *navbar>
</ion-navbar>
the back button is enabled. But I need to customize it (the icon or the label). Is it possible? Can't find anything in the docs/api.
you can set back button text in your app.html as mentioned in the ionic link http://ionicframework.com/docs/v2/api/config/Config
@App({
template: `<ion-nav [root]="root"></ion-nav>`
config: {
backButtonText: 'Go Back',
iconMode: 'ios',
modalEnter: 'modal-slide-in',
modalLeave: 'modal-slide-out',
tabbarPlacement: 'bottom',
pageTransition: 'ios',
}
})
UPDATE in ionic 2 beta 8
import {ionicBootstrap} from 'ionic-angular';
ionicBootstrap(AppRoot, customProviders, {
backButtonText: 'Go Back',
iconMode: 'ios',
modalEnter: 'modal-slide-in',
modalLeave: 'modal-slide-out',
tabbarPlacement: 'bottom',
pageTransition: 'ios',
});
UPDATE in ionic 2 rc.0 and up, as well as ionic 3
In ionic 2 rc.0 and up, we need to include the configs in app.module.ts under imports array.
@NgModule({
declarations: [
MyApp,
Home
],
imports: [
IonicModule.forRoot(MyApp, {
tabsPlacement: 'top',
backButtonText: 'Back'
})],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
Home ],
providers: [MyService]
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With