So I have this wizard in my web app, and I added url’s for each state now. My web app is in react but I have a bit of angular (I’m using angular state library.)
To change the urls, for example when I click on a button that takes me to the next page, I just do something like:
$state.go( $state.current.name,
{ someParam: someParamValue },
{
reload: false,
notify: false,
},
);
And it’s working. I also have breadcrumbs to go back, there I use the same method.
The problem is when pressing back in the browser. The url is changed – but the UI remain the same. From debugging I noticed the stateParams are according to the old URL.
How can I solve this?
I tried using ‘popstate’ ‘onpopstate’ but they are triggered even when I just move in the wizard or just load the page which is not good.
doit123 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.