I'm using angular routing(@angular/router) for ionic 4 project to disable the device back-button in ionic 4 prevent-default is not working below is my code in
app.component.ts
this.platform.backButton.subscribe(() => {
if (this.router.url === '/Login') {
this.util.presentAppExitAlert();
} else {
// event.preventDefault();
console.log("invoing url ", this.router.url);
}
});
});
i am not able to disable the device back-button any help here
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…