On client side I have $scope.loggedInUser, which refers to mongoose user schema. Another schema I'm using is a conversation schema. Every user can join conversation, in that case he will be added to conversation.participants array, which is defined like that:
var conversationsSchema = new Schema({
participants: {type: Array, default: []}
});
I want to display only conversation with current user (i.e. loggedInUser) in participants array. I tried
ng-repeat="conversation in conversations" ng-if="conversation.participants.indexOf(logged_in_user) > -1"
but I dodn't see any. How can I check if element exists in array in ng-if (or generally in angular) correctly?