Altough searched everywhere, could not find a solution I have a problem with deleting the CORRECT row from the list.
For example I have below array:
$scope.rows = [{
"ID": 12,
"customer": "abc",
"image": "abc.jpg",
},{
"ID": 13,
"customer": "klm",
"image": "klm.jpg",
},{
"ID": 14,
"customer": "xyz",
"image": "xyz.jpg",
}];
Trying to delete the row where ID = 13 (ID will be received from node server) with the code as follow:
Socket.on('delete', function( ID ) {
var a = $scope.rows.indexOf(ID);
$scope.rows.splice(a, 1)
});
But this removes not the correct row.
How can I specify my parameter to delete the right row like:
remove rows("ID" = ID)