I have used this.navCtrl.push() to navigate to a new page on click of a button. It creates a default back button clicking which takes me back to the previous page. I want to navigate to another page on click of the back button. How can I do that ?
I have tried this but it doesn't work :
constructor(public navCtrl: NavController, public navParams: NavParams,public platform: Platform) {
platform.ready().then(()=>{
platform.registerBackButtonAction(()=>this.myHandlerFunction());
});
}
myHandlerFunction(){
this.navCtrl.setRoot(VesselsearchPage);
}