I have this array in scope:
$scope.randomArray = [
{
prop1: 'val1',
prop2: {
value: '3',
unit: 'l'
}
},
{
prop1: 'val2'
},
{
prop1: 'val3',
prop2: {
value: '10',
unit: 'l'
}
}
];
Trying to make an ng-repeat through this only with objects having prop2
property set. I would not create a separate filter or scope function for this if not necessary, so I've tried this solution described here and here:
<div ng-repeat="random in randomArray | filter : { prop2 : '!!'}">
{{random}}
</div>
but it not works.
Here is the mcve: https://codepen.io/neptune01/pen/eWRBKd