Skip to content

Instantly share code, notes, and snippets.

@dagda1

dagda1/reduce-redux.js

Last active Aug 29, 2015
Embed
What would you like to do?
App.CompanyItemController = Ember.ObjectController.extend({
openDeals: Ember.computed.filter('deals.@each.{status,value}', function(item){
return item.get('state') !== 'lost';
}),
opendDealsValues: Ember.computed.mapBy('openDeals', 'value'),
total: Ember.computed.sum("opendDealsValues"),
dealTotals: App.computed.groupable('deals',function(deal){
return deal.get('state');
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.