(Using AngularJS)
I'm learning AngularJS and attempting a simple checkout system. I have 2 columns, on the left I have items, and on the right I have a basket(cart). Essentially you can add items from the left and they appear in the right basket.
The problem is, when you add an item to the basket that already exists, I get ngRepeat: dupes error in the console. I have handled functionality to increase the quantity for this but it prevent any further items from showing in the basket.
So ideally, I'd like to ignore the ng:repeat dupes error and continue adding items to the basket.
Here is a snippet of the basket;
<div ng:repeat='merchandise in merchandiseCtrl.basket' class='row'>
<div class='col-sm-3'>{{ merchandise.name }}</div>
<div class='col-sm-3'>
<input type='text' class='form-control input-sm' value='{{ merchandise.quantity }}' ng-model=' merchandise.quantity'>
</div>
<div class='col-sm-3'>{{ merchandise.price }}</div>
<div class='col-sm-3 '>
<button ng-click='merchandiseCtrl.removeItem(merchandise)' type='button' class='btn btn-link btn-xs'>
<span class='glyphicon glyphicon-trash'> </span>
</button>
</div>
<hr>
</div>
If I haven't explain clearly what I require or you require more code, please comment.
Example (Hopefully to clear any misunderstanding):
I hope this is more clear. Say you have a shirt already in your cart, and you would then like to add one more shirt (this works fine and I have functionality which adds 1 to the quantity) however, this errors ng:repeat dupes in the browser console window. Then when I attemp to add a Sweatshirt to the basket, the content in the basket will not be updated