Skip to content

Instantly share code, notes, and snippets.

@knownasilya
Last active August 29, 2015 14:14
Show Gist options
  • Save knownasilya/94e3c6bc6a37c165f5c0 to your computer and use it in GitHub Desktop.
Save knownasilya/94e3c6bc6a37c165f5c0 to your computer and use it in GitHub Desktop.
Sorting models without ArrayController
import Ember from 'ember';
export default Ember.Controller.extend({
sortedModels: Ember.computed('model', function () {
var model = this.get('model');
// filterBy, filter, sortBy, sort, or some manual work..
return model.sortBy('isTasty', true);
})
});
{{#each tasty in sortedModels}}
{{tasty-model model=tasty}}
{{/each}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment