The reason is that you are sending the $index for removing, instead of that pass the id like
<a href="" ng-click="delete(project.id)">X</a>
Try this out
$scope.delete = function(idx) {
for ( var i = 0; i < $scope.projects.length; i++){
if ($scope.projects[i].id === idx)
{
$scope.projects.splice(i, 1);
}
}
};