title: Using AngularJS $resource to get data
body: <p>I am trying to use $resource to get data from a static json file and here is the code snippet :</p>
  
  <pre><code> angular.module('app.services', ['ngResource']).
    factory('profilelist',function($resource){
      return $resource('services/profiles/profilelist.json',{},{
          query:{method:'GET'}
      });
  });
  </code></pre>
  
  <p>In the controller,</p>
  
  <pre><code>function ProfileCtrl($scope,profilelist) {
  $scope.items = [];
  $scope.profileslist = profilelist.query();
  for (var i=0;i&lt;=$scope.profileslist.length;i++){
      if($scope.profileslist[i] &amp;&amp; $scope.profileslist[i].profileid){
          var temp_profile = $scope.profileslist[i].profileid;
      }
      $scope.items.push(temp_profile);
  
  }
  </code></pre>
  
  <p>But now, I am facing an error : 
  <code>TypeError: Object #&lt;Resource&gt; has no method 'push'</code></p>
  
  <p>Could you please help me where I am going wrong ?</p>