title: Add items to a shopping cart in AngularJS
body: <p>Angular beginner here.
  I'm trying to create a shopping cart for college.
  I need to add the name and price in a text input and after clicking a button the item is supposed to be added to a list.
  The thing is that whenever I press the button nothing happens, and I'm lost since the console doesn't tell me anything about what could be wrong. So, here's my code: </p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html ng-app = "myApp"&gt;
  &lt;head&gt;
      &lt;title&gt;Shopping Cart&lt;/title&gt;
      &lt;script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"&gt;     &lt;/script&gt;
      &lt;script src = "app.js"&gt;&lt;/script&gt;        
  &lt;/head&gt;
  &lt;body ng-controller = "myShoppingCart"&gt;
  
              &lt;h1&gt;Add to cart&lt;/h1&gt;
              &lt;form &gt;
                      &lt;p&gt;Product: &lt;input type = "text" ng-model = "nameProduct"&gt;&lt;/p&gt;
                      &lt;p&gt;Price: &lt;input type = "number" min = "0" step = "any" ng-model = "priceProduct"&gt;&lt;/p&gt;
                      &lt;input type = "submit" value = "Add" ng-click = "addProduct()"&gt;
              &lt;/form&gt;
  
          &lt;/div&gt;
  
          &lt;div"&gt;
              &lt;ul&gt;
                  &lt;li ng-repeat = "product in products"&gt;
                      &lt;span&gt;{{product.name}}&lt;/span&gt;
                      &lt;span&gt;{{product.price}}&lt;/span&gt;
                      &lt;span&gt;&lt;input type = "number" min = "0" placeholder = "0" value = "0" ng-model = "amount"&gt;&lt;/span&gt;
                      &lt;span&gt;{{product.price*amount}}&lt;/span&gt;
                  &lt;/li&gt;
              &lt;/ul&gt;
          &lt;/div&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>And this is my js code:</p>
  
  <pre><code>var myApp = angular.module("myApp", []);
  
  myApp.controller('myShoppingCart', function($scope) {
  
   $scope.products = [];
  
   function addProduct() {
  
      $scope.productos.push({nombre:$scope.nameProduct, price:$scope.priceProduct});
      $scope.nameProduct = "";
      $scope.priceProduct = "";
   }
  
  });
  </code></pre>