Last active
August 29, 2015 14:07
-
-
Save typeoneerror/3254ac89fab560a943c9 to your computer and use it in GitHub Desktop.
ember.js property oopsie
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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