M
M
mortyy2018-04-16 14:42:51
JavaScript
mortyy, 2018-04-16 14:42:51

How to know the previous route?

There is a page with filters, if you press F5, then the filters should be saved. If you go to another page of the application and come back, then the filters should be reset to the default value. Tell me how to implement it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DarthJS, 2018-04-16
@DarthJS

- save the filter value in localstorage,
- when you go to another page, delete the value from localstorage
- when you return to the page using the goBack method or just by URL, you will have the initial value of the filter

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question