ionic2 - Ionic 2 App Back button behaviour to navigate to another page -
i have used this.navctrl.push() navigate new page on click of button. creates default button clicking takes me previous page. want navigate page on click of button. how can ?
i have tried 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); }
inject platform 'ionic-angular' , register new handler button action:
import { platform } 'ionic-angular'; constructor(private platform: platform) { } ionviewwillenter(): void { this.platform.registerbackbuttonaction(() => this.backbuttonfunc()); } private backbuttonfunc(): void { // }
Comments
Post a Comment