Last active
February 25, 2016 22:44
-
-
Save courtneyphillips/d1c572217ef983bb7adf to your computer and use it in GitHub Desktop.
Ember computed properties in components
This file contains hidden or 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
//in component | |
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
sortProperties: ['date:desc'], | |
sortedAnswers: Ember.computed.sort('comments', 'sortProperties'), | |
actions: { | |
... | |
} | |
}); | |
//calling component | |
{{some-component comments=post.comments}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment