I'm trying to group and add the similar elements in an array that I'm displaying in ng-repeat..
Plunker:Group Array Items
I tried to apply filter as:
<div ng-repeat="shape in shapes|filter:groupFilter">
{{shape.name}}- {{shape.value}}
</div>
$scope.groupFilter=function(item)=>{
return item.name===item.name;
}
where I'm not able to access the whole elements at a time so that I can compare the values and add them up.. The end result that I'm expecting is like this...
Circle- 17 Rectangle- 13