How to group by Month and sum same month branches by using anuglarjs ng-repeat html table

Posted by Kasani007 under AngularJS on 12/27/2016 | Points: 10 | Views : 309 | Status : [Member] | Replies : 0
Branch Month Amount
Branch1 10 2000
Branch2 11 3000
Branch1 10 3000
Branch2 10 3000
Branch3 12 4000
Branch2 12 5000
Branch1 12 6000

How can i group by Month and sum same month branches In angularjs using ng-repeat table

the output should be like


Branch1 10 5000
Branch2 10 3000
Branch2 11 3000
Branch1 12 6000
Branch2 12 5000
Branch3 12 4000

i had written code as below but not works :

<div class="table-responsive">

<table class="table table-striped project-stats">
<thead>
<tr>

<th>Branch</th>
<th>Month</th>
<th>Amount</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="data in BranchList | groupBy: 'Branch'">
<td>{{data.Branch}}</td>
<td>{{data.Month}}</td>
<td>{{data.Amount}}</td>
</tr>
<tr>
<td class="text-right" colspan="2"><strong>Grand Total:</strong></td>
<td><strong>{{GrandTotal}}</strong></td>
</tr>
</tbody>
</table>
</div>





Responses

(No response found.)

Login to post response