Reputation: 914
I make one application with IONIC-2 Beta version.I am trying to get alert before close the application.
In previous version of ionic 2 I used,
but in newer version this is not working.
How it is work with Type Script + ionic 2?
Upvotes: 1
Views: 496
Reputation: 1596
You have to register hardwarebackbuttonaction in app.component.ts like this:
platform.registerBackButtonAction(() => {
if(this.nav.canGoBack()){
this.nav.pop();
}else{
if(isAlertShowing){
//dismiss alert
}else{
//show alert
}
}
});
Upvotes: 1