Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Did you check whether it pushes route or pops it in navigation stack? When you push to navigation, according component is expected to being set up from scratch. When you pop, previous route's component state should remain intact, as state of other components in stack.
Problem may be lying in that these routes come as siblings and none of them is child of another, thus effectively replaced. -
Did you inject a state service or the router into your smart component in angular? You are responsible for state commutation there as well.
-
Or you could have a top-level component that never unmounts, holds the global state, and passes it as props to the <router-view>. Thats my fav approach
-
devTea219174yThis is expected, if you want to persist state between component then use vuex. If you want every state to persist then you have software design problem
Related Rants
I thought react/Vue/angular was used to build single page web app.
But why the hell are we losing components state when we navigate between routes?
question
vue
react
angular