[FEATURE query-params-new] Hopefully final iteration #4468

Merged
merged 1 commit into from Mar 10, 2014

Projects

None yet

5 participants

@machty
Member
machty commented Mar 5, 2014
  • default value'd QPs no longer show up in URL
  • default value's type is used to determine how
    deserialized QPs are cast into controller prop values
  • added queryParams Route config hash with properties
    replace and refreshModel to configure changed
    QP property behavior
  • better code organization

/w @raytiley's help

Updating examples from the QP guide

@machty machty added a commit to machty/website that referenced this pull request Mar 6, 2014
@machty machty Update Query Params guide to latest API iteration
See here for details, (don't don't merge this 
until that is merged):

emberjs/ember.js#4468
4228f1f
@machty machty referenced this pull request in emberjs/website Mar 6, 2014
Merged

Update Query Params guide to latest API iteration #1336

@machty machty [FEATURE query-params-new] Hopefully final iteration
- default value'd QPs no longer show up in URL
- default value's type is used to determine how
  deserialized QPs are cast into controller prop values
- added queryParams Route config hash with properties
  `replace` and `refreshModel` to configure changed
  QP property behavior
- better code organization

/w @raytiley's help
242af21
@machty machty merged commit 746adc2 into emberjs:master Mar 10, 2014

1 check passed

default The Travis CI build passed
Details
@kiwiupover
Contributor

Thanks for all the hard work here I really like the new api.

How should we remove a query-param from the request. I believe in the past ember would remove the param if it was set to something falsie. What is the plan going forward.

Cheers

@raytiley
Contributor

@kiwiupover I could totally be wrong, but I think the plan is to not serialize default values into the URL. So if you have:

App.MyController = Ember.ObjectController.extend({
  queryParams: ['search', 'sort'],
  search: null,
  sort: 'ascending'
});

You could get the items to go away by setting them to to default values.

{{link-to 'My Link' 'my' (query-params search=null sort='ascending') }}
@beerlington

@kiwiupover @raytiley not that it answers your question, but I think this issue is related to clearing the query-params #4447

@matthooks
Contributor

@matchy just wanted to make sure you saw #4494.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment