Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mahbub-shohag/2f61ba3cf7aa617e3755e718e4029151 to your computer and use it in GitHub Desktop.
Save mahbub-shohag/2f61ba3cf7aa617e3755e718e4029151 to your computer and use it in GitHub Desktop.
$scope.purchaseOrderCheckChange = function(purorderobj){
if($scope.itemList.length>0)
{
var found = $scope.itemList.some(function(o){
return purorderobj.PUR_REQ_NO === o.PUR_REQ_NO;
})
if(!found){
$scope.itemList.push(purorderobj);
}else{
var index = $scope.itemList.indexOf(purorderobj);
$scope.itemList.splice(index,1);
}
}
else{
$scope.itemList.push(purorderobj);
}
console.log($scope.itemList);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment