I have an array like this:
$scope.emails = [
{\"key\":\"Work\",\"value\":\"user@domine.com\"},
{\"key\":\"\",\"value\":\"\"},
{\"key\":\"Work\",\"value\":
According to the docs, the iterator function allows a third parameter which is the collection which is being iterated. Splicing that collection instead of $scope.emails
will remove the expected obejct.
angular.forEach($scope.emails, function(email, index, obj){
if(email.value ===""){
obj.splice(index, 1);
}
});