I tried filtering a group of checkboxes with an array like so:
<ion-checkbox ng-repeat="user in users | filter: {id: group.members}" ng-model="user.checked">{{user.info.name}}</ion-checkbox>
where group.members
is an array of user.id
and it just doesn't show anything.
users Array:
[12345,123456]
group.members Array:
[12345]
I'm trying to accomplish not showing the group.members
in the list of users
, because in this case a user is trying to invite another user
to the group
and why invite someone who's already a member?
I tried creating my own filter, but its just a mess:
.filter('existingMembers', function() {
return function(users, members) {
return users.filter(function(user) {
for (var i in user.id) {
if (members.indexOf(user.id[i]) != -1) {
return;
}
}
return user;
});
};
})