I am currently utilizing Angular routing with @angular/router in my Ionic 4 project. I have been attempting to disable the device back-button in Ionic 4, but prevent-default is not working for me. Below is the code snippet from my app.component.ts file:
this.platform.backButton.subscribe(() => {
if (this.router.url === '/Login') {
this.util.presentAppExitAlert();
} else {
// event.preventDefault();
console.log("invoking url ", this.router.url);
}
});
I am struggling to successfully disable the device back-button. Any assistance or guidance would be greatly appreciated.