I have an array like this:
$scope.emails = [ {\"key\":\"Work\",\"value\":\"user@domine.com\"}, {\"key\":\"\",\"value\":\"\"}, {\"key\":\"Work\",\"value\":
The problem is that you remove elements from the array during the loop so later items are at different indices. You need to loop backwards instead:
for (var i = $scope.emails.length - 1; i >= 0; i--) { if (!$scope.emails[i].value) { $scope.emails.splice(i, 1); } }
Here's an updated example.