title: Increment decrement quantity with Angular form
body: <p>I'm trying to implement an increment/decrement function on my form for a list of products. The idea is to be able to add products to cart with live update of the cart through products quantity.</p>
  
  <p>I came across this code sample from Angular docs which I think could do the trick.
  <a href="http://docs.angularjs.org/api/ng/directive/ngClick" rel="nofollow noreferrer">http://docs.angularjs.org/api/ng/directive/ngClick</a></p>
  
  <p>What I'm expecting is when I click on product for the first time it adds product to form params then increment each time I tap on product (Another solution would be to style html5 number field though but still issue with form fields logic)</p>
  
  <p><img src="https://i.stack.imgur.com/M4u4a.jpg" alt="enter image description here"></p>
  
  <p><code>"order": [{"product_id": "2", "quantity": "10"}, {"product_id": "5", "quantity": "12"}]</code></p>
  
  <p>My problem is:
  - I can't get form right (product_id * quantity) using formData
  - Increment quantity function is way off</p>
  
  <p>Plunker <a href="http://plnkr.co/edit/lCZUXpTeJqGkOllXaS2t?p=preview" rel="nofollow noreferrer">http://plnkr.co/edit/lCZUXpTeJqGkOllXaS2t?p=preview</a></p>
  
  <pre><code>&lt;form ng-submit="processForm()"&gt;
    &lt;pre&gt;{{ formData }}&lt;/pre&gt;
  
      &lt;ul ng-repeat="product in filtered = (products | orderBy:['name'] | filter:q)"&gt;
        &lt;li&gt;{{ product.name }}
           &lt;a ng-click="count = count + 1" ng-init="count=0" ng-model="formData.products"&gt;Increment - count: {{count}}
            &lt;input type="number" ng-model="formData.{{product.id}}" /&gt;
       &lt;/a&gt;
     &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/form&gt;
  </code></pre>