Skip to content

Instantly share code, notes, and snippets.

@typeoneerror
Last active August 29, 2015 14:07
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save typeoneerror/3254ac89fab560a943c9 to your computer and use it in GitHub Desktop.
ember.js property oopsie
queryParams: ['draft'],
draft: null,
courses: function() {
isDraft = this.get('draft');
return this.get('model').filterBy('isDraft', isDraft).sortBy('name');
}.property('draft'); // courses are filtered when draft query param changes
courses: function() {
isDraft = this.get('draft');
return this.get('model').filterBy('isDraft', isDraft).sortBy('name');
}.property('draft', 'model.[]'); // now courses gets updated when records are added to store
queryParams: ['draft']
draft: null
courses: ( ->
isDraft = @get('draft');
@get('model').filterBy('isDraft', isDraft).sortBy('name')
).property('draft', 'model.[]')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment