Goal: I have a search form with about 10 parameters. When the user fills out these parameters and does a search, I want to save the parameters they used, in order to prefill them when they return to the site at another time.
What I’ve done so far: When a user does a search, I take the full set of query params and save it to localstorage.
What I’m unsure about: Right now when it comes time to re-apply the saved config, I’m doing it in the init hook of my search service. (There’s a two way binding between the search route’s queryparams, and the values in my search service)
This has a problem in that it sets the values so early that ember treats them as the default queryparam values, which means that they don’t show in the url.
When/how can I apply the saved search config so that the form is prefilled, the search results are the results of the prefilled values, but so that it doesn’t override the default values?