I have the following code:
<td ng-repeat="actividad in actividades | filter:{circular_id: puntuacion.circular_id, tipo_a_id: 1}">
<span ng-repeat="puntuacion in puntuaciones | filter:{club_id: club.id,
actividad_id: actividad.id}" ng-bind="puntuacion.puntos || 0" ng-
init="total(puntuacion, club)"></span>
</td>
With ng-init="total(puntuacion, club)"
, I want to generate the total points per row, that is, per club.
The total function is as follows:
$scope.total = function(puntuacion, club){
if(puntuacion.club_id == club.id){
$scope.total[club.id] += (puntuacion.puntos);
}
}
This function generates me is the last value that each club has and not the sum of each one of them.
Look at the result:
Please, I thank you in advance for your help!