Skip to content

"groupBy" throws Converting circular structure to JSON #119

@stubbies

Description

@stubbies

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions