Genu
Genu

Reputation: 1104

Restore the query parameters for a state

What is the best approach for storing the query parameters for a state. For example, I have a state issues with the url like this issues/search?keyword=query&date=4/12/15

When the user navigates away from this state, and then go back to this state is there a way to restore that query string?

The idea, being, is to allow the user to return to the search results.

What is a good way to go about this?

Upvotes: 1

Views: 176

Answers (1)

ShankarSangoli
ShankarSangoli

Reputation: 69915

I think instead of rerendering the search results by reading the querstring params you can take a look at stick states here http://christopherthielen.github.io/ui-router-extras/#/sticky

This way you can optimize your application by preserving the states which involve heavy transactions like searching and at the same time i solves your problem.

Upvotes: 1

Related Questions