title: AngularJS ng-repeat: push object to array
body: <p>I have an object for selectedProduct. I now want to create an array of these selectedProduct objects so I can build a list using ng-repeat. I;ve set the scope to an empty array but what is the angular way to push these so I can access them via ng-repeat, i.e. product in products.</p>
  
  <pre><code> $scope.products = [];
  
      $scope.getProduct = function() {
          ProductService.getProduct($scope.eanInput.ean)
          .then(function(product) {
              $scope.selectedProduct = product;
              $scope.selectedProduct.ean = $scope.eanInput.ean;
              $scope.selectedProduct.qtyInput = 1;
              $scope.focusOn = 'qty';
  
              $scope.eanInput.productFound = true;
          })
          .catch(function() {
              $scope.eanInput.productFound = false;
          });
      };
  </code></pre>