Arkham2017-04-20 16:58:31
Arkham, 2017-04-20 16:58:31

Angular2: How to save/restore component state when switching between routes?

There is a catalog component in which the user can select filters, sorts, scroll to a certain "page" of infinite scrolling.
When you go to the product page from the catalog, and then return to the catalog page, you need to restore all the selected filters / sorting, as well as the location on the "page".
How could I "dump" the state of a component/page and then restore it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Nicholas, 2017-04-20

The component must be stateless, all state is stored in the service.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question