13 lines
392 B
JavaScript
13 lines
392 B
JavaScript
import Ember from 'ember';
|
|
|
|
const WeekGoalTotalGoalComponent = Ember.Component.extend({
|
|
tagName: '',
|
|
totalGoal: Ember.computed('goals.@each.goal', function() {
|
|
return this.get('goals').map(it => it.goal).reduce((pv, g) => pv + parseInt(g), 0);
|
|
})
|
|
});
|
|
WeekGoalTotalGoalComponent.reopenClass({
|
|
positionalParams: ['goals'],
|
|
});
|
|
|
|
export default WeekGoalTotalGoalComponent; |