Sorting
Ember
ArrayController
Estella Madison / @chicagoing
It's just an ArrayProxy with
ControllerMixin
SortableMixin
SortableMixin
exposes
sortProperties
sortAscending
sortFunction
arrangedContent
Example
@baaz
wrote about a better approach using
Ember.computed.sort
Ember.computed.sort
A macro in the reduce_computed_macros package
Two parameters:
itemsKey (string)
sortDefinition (string or function)
Example
Advantages of using
Ember.computed.sort
Use different sort criteria for sorted properties
You can use a custom comparison function
Sort by computed properties (example)