title: TypeError:productlist.products.push is not a function
body: <p>Here is code for Factories</p>
  
  <pre><code>        LifeStyleFactoryMOdule.factory("PurchaseFactory",function(){
  
  var productlist={products:[]};
  
  return{
      getpurchaseCart:function(){
          return productlist;
      },
      addPurchaseCart:function(products){
  
      productlist.products.push(products);
  
  },
      deletePurchase:function(idx){
          productlist.products.splice(idx,1)
      }
  
  }
  })   
  </code></pre>
  
  <p>Services</p>
  
  <pre><code>LifeStyleServiceModule.service("PurchaseService",function(PurchaseFactory){
  
  this.getAllPurchase=function(){
      return PurchaseFactory.getpurchaseCart();
  }
  this.addPurchase=function(products)
  {
      PurchaseFactory.addPurchaseCart(products);
  }
   this.deletePurchase=function(idx,id)
  {
      PurchaseFactory.deletePurchase(idx,id);
  }
  
  })
  </code></pre>
  
  <p>Controllers having function</p>
  
  <pre><code> LifeStyleController.controller("PurchaseController",function($scopePurchaseService){   
  $scope.savepurchase=function(products){
  
      if($scope.products._id==undefined){       
  
          $scope.products=angular.extend($scope.products,$scope.sizes)
           PurchaseService.addPurchase($scope.products);
         $scope.products={};
    $scope.sizes={size:[]}
  
  }
  }
  </code></pre>
  
  <p>In HTML i having a button and all the data i am sending.
  First Time I push the data is is done successfully, but for second time its showing me error as productlist.products.push is not a function</p>
  
  <p>Knowing answer will be great help</p>