Hi, i hope someone can help in here…
i like to create a simple shopping cart
this is the list of items i display with ng-repeat=item in items in list item
in this list html i also have a quantity that is zero (0) for each item
this is the list of order created by the user (cart)
i like to add items in to it (add with code, name, price and quantity)
if user select item quantity is more than 0 i like to add it to the order array
and if the user reduce the quantity to zero, i like to remove the item from the array
$scope.order = [];
what function i should add to do it (add/remove)??
but how do bring in the quantity thing?
the remove from order array should be when the quantity is 0
and the add item should be when quantity is more than 0
yes, this is what i need
what i think to do now is to add to my items array also a quantity:0;
than in this qty i will have a simple ng-click to change the qty
than in the functions of additem and remove i like it to “watch” the qty’s and when an item qty in more than zero than to add it to the order array,…