Calculate the total price of the column with ng repeat

Asked

Viewed 23 times

-1

I am trying to sum up in the column of total prices, but it is not updated as you search, the value keeps the total sum and not the items that are showing.

angular.forEach($scope.receivables, function (item) {
  $scope.valueTotalReceivable += item.price++;
  return $scope.valueTotalReceivable;
});

I would like to show the updated values of the full price column while searching.

1 answer

0

I have resolved this amendment:

    $scope.totalIncome = function (filteredArrayIncome) {
      let total = 0
      for (let i = 0; i < filteredArrayIncome.length; i++) {
        const sum = filteredArrayIncome[i]
        total += parseFloat(sum.service_price)
      }
      return total
    }

If anyone has a better answer, I’d be grateful. :)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.