hi all,
please help me custom back button in ionic 2 rc0. I want to change icon and text in all page which using back button. any way to do it?
thank all
hi all,
please help me custom back button in ionic 2 rc0. I want to change icon and text in all page which using back button. any way to do it?
thank all
use any button, and call a function to pop out the view like with this line:
this._navController.pop();
Please show more info. so, I think I have to loop this code in each page. It’s not good.
well, yes, indeed is needed in every component you want to implement if you wan a custom back button, maybe you can implement it as a service.
So, in template is
<button ion-button (click)=“goBack()”>Custom back button
In ts file:
import { NavController } from ‘ionic-angular’;
in constructor define:
constructor(public _navController: NavController ){ … }
and after constructor function:
goBack() {
this._navController.pop();
}
That’s it
instead of injection navcontroller you can simply add a button and use the “navPop” directive at this button:
<button ion-button navPop>Back</button>
It work well, Thanks
That’s good to know!! great!