Friends, I have the following problem. I have an arrangement with 3 elements which I should consult in a BD. By the time one matches the base records, I need the loop to skip to the next value in the array.
What I have so far is this:
restAPI.query(function (adt) {
$scope.areaDocumentTypes = adt;
angular.forEach($scope.collection, function (dt) {
angular.forEach($scope.areaDocumentTypes, function (item) {
if ($scope.idArea == item.idArea && dt.idDocumentType == item.idDocumentType) {
if (!dt.selected)
//Código...
}
else
if (dt.selected)
//Código
});
});
});
I tried a return after the else but it did not work.
Any suggestions are appreciated!