Nid Help guys!
There is an array
$scope.contacts = [ { "id": "1", "name": "first name", "surname": "first surname", "age": "29", "group": "group 1", "description": "This is first", "note": "some notification" }, { "id": "2", "name": "second name", "surname": "second surname", "age": "27", "group": "group 2", "description": "This is first", "note": "some notification" }, { "id": "3", "name": "third name", "surname": "third surname", "age": "25", "group": "group 1", "description": "This is first user", "note": "some notification" }] The thing is done on Angular. In one tab, you need to display a list of all users (there are no problems with this). In the second - the name of the groups and its members. Tell me, please, how to filter by groups!
I get a list of groups that exist:
$scope.selectGroups = new Set(); $scope.groups = []; var test = []; for (var i = 0; i < $scope.contacts.length; i++) { $scope.selectGroups.add($scope.contacts[i].group); } test = JSON.stringify(Array.from($scope.selectGroups)); $scope.groups = JSON.parse(test); Beginner and I understand that I do not know much. I hope for help!