They searched everyone everywhere, could not find a solution. I had a problem removing the CORRECT line from the list.
For example, I have an array below:
$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 a line where ID = 13 (ID will be obtained from the node server) with the code as follows:
Socket.on('delete', function( ID ) {
var a = $scope.rows.indexOf(ID);
$scope.rows.splice(a, 1)
});
But this does not delete the correct line.
How can I specify my option to delete the right line, for example:
remove rows("ID" = ID)
source
share