Manipulating Angular navigation history on reload

#1

Hi,

My use case simple: how could I use the ion-back-button after a page has just reloaded ?

Let’s say I’m loading directly the page app/product/2132235/edit-product, how could I use ion-back-button to go to app/product/ ?

Angular doesn’t have a navigation history as we used to have in Ionic 3.

Thank you

#2

According the code there is an option defaultHref for back button, is that maybe what you are looking for?

/**

  • The url to navigate back to by default when there is no history.
    */
    @Prop() defaultHref?: string;

source: https://github.com/ionic-team/ionic/blob/0e91aa75ac5b21f1b1bf9125ce77fee51a90afe3/core/src/components/back-button/back-button.tsx