I have written a function which is involving multiple loops.
$scope.matchFunction = function() {
angular.forEach(datas, function(data) {
angular.forEach(data.innerdatas, function(nnerdata) {
if (innerdata.id === 'ABCD') {
console.log('matched');
//matched return true and break and stop executon
return true;
}
});
});
return false;
};
But I am always ending up in returning false.
I think I am not able to return from nested loops.
Any help.