Right now the proposal is to define the names of the query params in one spot on the controller like this:
App.IndexController = Ember.ArrayController.extend({
queryParams: ['search', 'sort']
search: null,
sort: null
});
And then define the behavior somewhere else like this:
App.IndexRoute = Ember.Route.extend({
queryParams: {
search: {
transition: true, // default is false
pushState: false // default is true
}
// the sort query-param isn't defined here so it would get default behavior
}
});
This seems akward to me as you now have two different places where you have knowledge about queryparams. It would be nicer to define them and their behavior all in one spot. Doesn't matter to me where. The simplest idea is to just use the above example how how they are defined on the route.
App.IndexRoute = Ember.Route.extend({
queryParams: {
search: {
transition: true, // default is false
pushState: false // default is true
}
sort: {} // This time we need to define sort with an empty object since this is declaring the qp as well as setting options.
}
});
It makes little difference to me if this was defined on the route or the controller...
App.IndexController = Ember.ArrayController.extend({
queryParams: {
search: {
transition: true,
pushState: false,
}
sort: {}
},
sort: null,
search: null
});