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