Advertisement
Guest User

Untitled

a guest
Jan 24th, 2015
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     $scope.removeProduct = function () {
  2.         //look through current discount's products for a match with the product clicked on
  3.         for (var i = 0; i < $scope.currentDiscount.DiscountProducts.length; i++) {
  4.             //if the id's are the same
  5.             if ($scope.currentDiscount.DiscountProducts[i].ProductCategoryId=== $scope.currentProduct.ProductCategoryId) {
  6.                 //remove it
  7.                 $scope.currentDiscount.DiscountProducts.splice(i, 1);
  8.             }
  9.         }
  10.     };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement