title: angularjs push object undefined is not a function
body: <p>So, I have a problem with this code and I don`t know why I get that error</p>
  
  <pre><code>$scope.veilingen = {};
  $http.get('./helpers/get/Veilingen.php').
  success(function(data) {
      if(debugMode) console.log(data);
      $scope.veilingenCache = data;
      for(var i = 0; i &lt; 2; i++) {
          console.log($scope.veilingen)
          $scope.veilingen.push({
             test: 'hello'
          });
          console.log($scope.veilingen)
      }
  });
  </code></pre>
  
  <p>I get this error:</p>
  
  <blockquote>
    <p>TypeError: undefined is not a function
        at <a href="http://example.com/includes/controllers/veilingCntrl.js:12:30" rel="noreferrer">http://example.com/includes/controllers/veilingCntrl.js:12:30</a>
        at <a href="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.18/angular.min.js:72:72" rel="noreferrer">http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.18/angular.min.js:72:72</a>
        at I (<a href="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.18/angular.min.js:100:144" rel="noreferrer">http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.18/angular.min.js:100:144</a>)
        at I (<a href="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.18/angular.min.js:100:144" rel="noreferrer">http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.18/angular.min.js:100:144</a>)
        at <a href="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.18/angular.min.js:101:308" rel="noreferrer">http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.18/angular.min.js:101:308</a>
        at k.$eval (<a href="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.18/angular.min.js:112:32" rel="noreferrer">http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.18/angular.min.js:112:32</a>)
        at k.$digest (<a href="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.18/angular.min.js:109:121" rel="noreferrer">http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.18/angular.min.js:109:121</a>)
        at k.$apply (<a href="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.18/angular.min.js:112:362" rel="noreferrer">http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.18/angular.min.js:112:362</a>)
        at h (<a href="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.18/angular.min.js:72:327" rel="noreferrer">http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.18/angular.min.js:72:327</a>)
        at x (<a href="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.18/angular.min.js:77:288" rel="noreferrer">http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.18/angular.min.js:77:288</a>)</p>
  </blockquote>
  
  <p>Line 12 is the push() area. I have searched why this happens but I can`t find it. What I want is that the object veilingen gets the first 2 results and after its load the user can change it with:</p>
  
  <pre><code>$scope.setLimitVeiling = function(items) {
      for(var i = 0; i &lt; items; i++) {
          $scope.veilingen.push($scope.veilingenCache[i]);
      }
  }
  </code></pre>
  
  <p>But yeah, if push is not working...?</p>