I am using Angular 8. I want to check in Angular if object exists inside array of objects or not. My object is :
let objVenIns = {
'CntNumber': 4,
'CntMixer': 2,
'DevicePositions': 'NA',
'AddComments': 'NA',
}
Array of object contains other columns as well:-
let arrRowData = [0: {'SrNo' : 1, 'Name' : 'ABC', 'CntNumber': 1,'CntMixer': 3,'DevicePositions': 'Right','AddComments': 'NA'},
1: {'SrNo' : 2, 'Name' : 'DEF', 'CntNumber': 4,'CntMixer': 2,'DevicePositions': 'NA','AddComments': 'NA'},
2: {'SrNo' : 3, 'Name' : 'XYZ', 'CntNumber': 2,'CntMixer': 5,'DevicePositions': 'Left','AddComments': 'NA'}]
In Angular JS I used to perform following function to check if object exists in array or not:-
var data = $filter('filter')($scope.arrRowData, objVenIns, true)[0];
How to achieve such object search in Angular 8?