In my app i have 2 pages home.ts and page2.ts, home page has a button to open the page2,
openPage(){
this.navctrl.push('page2');
}
and in page 2 i have another button that will open a model that is page3 like below
presentModal() {
let modal = this.modalCtrl.create(page3 );
modal.present();
}
so far ok, if i opened the modal, pressing device back button will close the modal,and pressing again will pop the page2 and home page wil be now the active page, it will quit the app if i press the device backbutton again.
i want to use a confirm alert box in home page before quit the app, but device backbutton should work normally in other pages (page2, page3) ,
what i am looking is to show a ad just before the app quit, without much headache with registerbackbutton,and it is very easy with ionic1. i dont understand your code how it works for my need