I want to hide a div if no object within a array has a specific property set to false.
The property looks like this:
$scope.myObjArray = [
{"Id":"1","IsBuiltIn":true},
{"Id":"2","IsBuiltIn":true}
];
I want to hide my div if there is no object within myObjArray that has IsBuiltIn set to false. So the above array should hide the div. The following should show it (because at least one object has IsBuiltInset to false):
$scope.myObjArray = [
{"Id":"1","IsBuiltIn":true},
{"Id":"2","IsBuiltIn":true},
{"Id":"3","IsBuiltIn":false}
];
I tried to solve this using a ForEach without success:
<div ng-show="myObjArray.ForEach(e, function(){e.IsBuiltIn})">
Hello, World!
</div>
Here is my plnkr.