I have something like this:
users = [
{ id: 1, location: "Japan", location_id: 1},
{ id: 2, location: "Germany", location_id: 2},
{ id: 5, location: "Germany", location_id: 2},
{ id: 3, location: "France", location_id: 3},
{ id: 4, location: "France", location_id: 3}
]
<li ng-repeat="(key, value) in users | groupBy: 'location_id'">
{{key}}
</li>
Getting TypeError: Converting circular structure to JSON at Object.stringify (native)
It works with countBy but with that I don't have access to location, and I can't do this:
- Germany (2)
- France (2)
- Japan (1)