Skip to content

Instantly share code, notes, and snippets.

@joeltrew
Created December 13, 2015 17:02
Show Gist options
  • Save joeltrew/abfaa85b81c9117f39a1 to your computer and use it in GitHub Desktop.
Save joeltrew/abfaa85b81c9117f39a1 to your computer and use it in GitHub Desktop.
Ember component for display apps
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['apps-page'],
sortProperty: ['name'],
sortedApps: Ember.computed.sort('apps', 'sortProperty'),
actions: {
alphabeticalSort() {
this.set('sortProperty', ['name'])
},
dateSort() {
var sortByLatest = function(a,b){
return b.get('last_built') - a.get('last_built')
}
this.set('sortProperty', sortByLatest)
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment