Skip to content

Instantly share code, notes, and snippets.

@stevekane
Created May 29, 2013 16:28
Show Gist options
  • Save stevekane/5671652 to your computer and use it in GitHub Desktop.
Save stevekane/5671652 to your computer and use it in GitHub Desktop.
App.MyMixin = Ember.Mixin.create({
sortedContent: function () {
//return sorted content
}.property('content'),
sortManagerClass: Ember.StateManager.extend({
defaultState: "none",
none: Ember.State.extend({
//define event responses
}),
ascending: Ember.State.extend({
//define event responses
}),
descending: Ember.State.extend({
//define event responses
}),
}),
});
App.MyController = Ember.ArrayController.extend(App.MyMixin, {
init: function () {
this.set('sortManager', this.get('sortManagerClass').create();
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment