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