Struggling to calculate the total of the amounts in the 3rd column. Any tips on how to achieve this?
<body ng-app="Test">
<section style="margin-top:80px">
<div ng-controller="TestController as test" >
<table class="table">
<tr>
<th>Name</th>
<th>Number</th>
<th>Amount</th>
<th>Reduced Amount</th>
</tr>
<tr ng-repeat="x in test.approve">
<td> {{ x.name }} </td>
<td> <input class="qty form-control" type="number" ng-model="x.number" ng-change="sumByColumn3()" min="0" restrict-to="[0-9]"/> </td>
<td> <span ng-model="x.amount" ng-change="sumByColumn()">{{ x.number*x.amount }}</span> </td>
<td> <input class="qty form-control" type="number" ng-model="x.reducedAmount" ng-change="sumByColumn2()" min="0" restrict-to="[0-9]"/> </td>
</tr>
<tr>
<td style="color:red;">Totals displayed here</td>
<td>{{ test.approve | sumByColumn3: 'number' }}</td>
<td>{{ test.approve | sumByColumn: 'amount' }}</td>
<td>{{ test.approve | sumByColumn2: 'reducedAmount' }}</td>
</tr>
</table>
</div>
</section>
</body>
Check out the complete code here