I am trying to implement functionality where I have a list of products and when I click on one of them it will open a details page with suggested products.
It is working fine if the user provides an existing product id, but when the user manually changes the id of the product to something that is not valid, I need to cancel the navigation, show a snack bar alert and stay where the page was.
I don't want to redirect to an error page. I'd prefer to stay at the same place and show the message. I cannot use a guard because it would have to fetch the product from the db.