QueryParams - How to load initial state for query params in list views?


#1

We are trying to move our app to Ember 1.8.1 from 1.6.1

We have decided to move the filters and pagination in the list views to QueryParams. However in the process we have stumbled upon a situation.

We currently save the current state of filters, which we restore on next login. (We load the list view states through a global variable on index.jsp). After migration, we typically want to be able to set initial values for query params of routes before visiting them.

For eg.

If the user last viewed contacts route with state

/contacts?filter_by=friends&sort_order=descending.

On the next login, when the user visits contacts route we want the initial state to be

/contacts?filter_by=friends&sort_order=descending.

Which hook would be the best place to set this initial state of the query params?