I've been struggling to find a way to show the count of duplicate results when using the ng-repeat
method.
<label data-ng-repeat="x in projects | unique:'b' | orderBy:'b'" >
<input
id="x.b"
type="checkbox"
ng-click="toggleSelection(x.b)"
ng-checked="selectedRefs.indexOf(x.b) > -1" />
{{x.b}}
</label>
http://plnkr.co/edit/zhH07DSHcofTxjFiE1TG?p=preview
In the example from Plunker, the checkboxes go through each 'refs' and display a unique checkbox for each one. I am looking to include a count next to each checkbox to indicate how many times a specific 'ref' appears. For example:
123 appears twice so it would show as:
123 (2)
456 appears twice so it would show as:
456 (2)
654 appears thrice so it would show as:
654 (3)
987 appears once so it shows as:
987 (1)
Any suggestions would be greatly appreciated.