title: How do I increase the quantity of an item already in a shopping cart?
body: <p><a href="https://i.stack.imgur.com/7kpBV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7kpBV.png" alt="App screenshot"></a></p>
  
  <p>I have four items in my app. If I click <code>Order</code>, an item gets added to the card. If I click <code>Order</code> again, I want to increment the <code>quantity</code> of the item in the cart, but right now it just adds another item to the cart.</p>
  
  <pre><code>var app = angular.module("myMenuApp", []);
  
  //MenuController
  app.controller("MenuController", function($scope, vorders) {
    var menuitems = [
      {"code": "VG101", "name": "PalakPaneer",  "price": 300, "description": "palak paneer description"},
      {"code": "DS101", "name": "Malai Kopta",  "price": 200, "description": "Malai Kopta description"},
      {"code": "AN101", "name": "Gobi Fry",     "price": 250, "description": "Gobi Fry description"},
      {"code": "VS101", "name": "Methi Chaman", "price": 280, "description": "Methi Chaman description"}
    ];
  
    $scope.itemsList = menuitems;
  
    $scope.placeOrder = function(menuitem){
      var OrderItem = { "name":menuitem.name, "price": menuitem.price, "qty":1 };
      vorders.push(OrderItem);
    }
  })
  
  
  //OrderedController
  app.controller("OrderedController", function($scope, vorders){
    $scope.ordereditems=vorders;
  
    $scope.cancelOrder = function(idx) {
      vorders.splice(idx, 1);
    }
  
    $scope.totalAmount = function() {
      var tot = 0;
      angular.forEach(vorders, function(c) {
        tot += (c.price * c.qty);
      })
      return tot;
    }
  })
  
  app.value("vorders", []);
  </code></pre>