Does anyone know how I could either a) force my app to re-start from scratch every time the user launches the app or b) re-display a particular page when the app re-starts e.g on resume.
I have a tabbed Ionic 2 application with a login page which I display on start-up, and then when the user logs in my TabsPage is pushed onto the nav. I want to get that initial login page to display every time the user opens the app, rather than have the application open up with the tabs already open.
In my app.js I have:
class MyApp {
constructor(platform: Platform) {
this.root = LoginCtrl;
platform.ready().then(() => { this.bindEvents(); });
}
bindEvents: function () {
document.addEventListener(āresumeā, this.onResume, false);
}
onResume: function () {
console.log(āon resumeā);
this.root = LoginCtrl;
}
}
This doesnāt work i.e the LoginPage is not re-displayed although the onResume event is firing.
What would I need to do to get that to work?