Hi,
I’m looking for a way to redirect a user back after a click on a button if said back exists, and to a specific route otherwise.
I need to add a condition to my code, but Idon’t seem to find a way.
goback() {
if("something") {
this.navCtlr.setDirection('back');
this.location.back();
}
else {
this.router.navigate(['/']);
}
}
In Ionic 3 we had canGoBack() function… Any idea for Ionic 4?
Thanks.