Here is the current json structure:
$scope.dataList = [{
CompanyName: null,
Location: null,
Client: [{
ClientId: 0,
ClientName: null,
Projects:{
Id: 0,
Name: null,
}
}]
}];
I'm attempting to
remove client data based on a specific clientid from the list of clients
, but for some reason, the client data is not being removed and there are no error messages being displayed.
Check out the code snippet below:
for (var i = 0; i < $scope.dataList.length; i++)
{
for (var j = 0; j < $scope.dataList[i].Client.length; j++)
{
if ($scope.dataList[i].Client[j].ClientId == 101)
{
$scope.dataList[i].Client.splice(j, 1);
}
}
}
Could someone please help me identify what might be wrong with my code?