I have json object with following structure:
$scope.sellAccessories[0]=[
{id: [178], item_name: ["Nescafe","ggfftrww"], quantity: [1], total_price:[300]}
]
my problem is that i want to remove some elements from the array before i send the json object to the server side.
i tried to remove the second element in the array item_name which is ggfftrww using the splice function:
var index = $scope.sellAccessories[0].item_name.indexOf($scope.sellAccessories[0].item_name[1]);
if (index > -1) {
$scope.sellAccessories[0].item_name.splice(index, 1);
}
but it didn't work.
thanks in advance this is stopping my work flow.