T
T
tolalur2018-09-05 20:25:57
Angular
tolalur, 2018-09-05 20:25:57

How to pass/save parameters to queryParams and reuse when using reuse strategy?

Good day.
There is an application on angular 5. In it, for example, 2 components. For the first one, reuse strategy is set. Also, when the state of the component changes (for example, the user stumbled on something in the menu), this is written in queryParams to save the state at F5.
When navigating to the second component and back, queryParams get lost. In this case, the state of the first component is saved.
Question - is it possible to somehow substitute queryParams with reuseStrategy?
So far, I have done this - subscribed to routing events and if there is a transition to the desired component, I check the correspondence of the state and queryParams and substitute it if necessary.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tonx92, 2018-09-05
@tonx92

It's not entirely clear from the description, but it seems to me that it would be much more convenient to put your queryParams in localStorage.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question