angular forEach not working with ng-if function but working using simple if Please check fiddle
https://jsfiddle.net/hzdyhx4n/
angular.module('app5', []).controller('ctrl', function($scope) {
$scope.z = [ { name: 'aa', id: 55, picture: [1,4,3] } ];
$scope.display = function(x) {
angular.forEach(x.picture, function(val,key){
console.log(val);
if (val === 4) {
console.log("true");
return true;
} else {
console.log("false");
return false;
}
});
};
});