Created
December 13, 2015 17:02
-
-
Save joeltrew/abfaa85b81c9117f39a1 to your computer and use it in GitHub Desktop.
Ember component for display apps
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
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