With the following code, I am saying that in the second array contained in the object $scope.listademercadoria
there is the property "quantity", and I am declaring it as value 0.
$scope.listademercadoria[1].quantidade = 0;
Is there a way to select only the array that contains a certain id as property?
Ex: $scope.listademercadoria[id = 2].quantidade = 0;
If it works, it would only take the arrays that contain id = 2 and would set the amount to 0.
Is there any way I can do this without using $filter
? If not, how would it look like $filter
?