title: Error: [$resource:badcfg] Error in resource configuration. Expected response to contain an array but got an object
body: <p>I am a complete noob with respect to angular, just going through a codeschool tutorial and I've hit my first hurdle.</p>
  
  <p>I am getting <code>Error: [$resource:badcfg] Error in resource configuration. Expected response to contain an array but got an object</code> </p>
  
  <p>Here is my code:</p>
  
  <pre><code>var bulletinApp = angular.module('bulletinApp', ['ngResource']);
  
  bulletinApp.controller('PostsController', ['$scope', 'Post', function($scope, Post) {
      $scope.heading = 'Welcome';
      $scope.posts = Post.query();
  
      $scope.newPost = {
          title: 'Test Post'
      }
  
  }]);
  
  bulletinApp.factory('Post', ['$resource', function($resource) {
      return $resource('/posts');
  }]);
  </code></pre>
  
  <p>I found an answer here:
  <a href="https://stackoverflow.com/questions/20037852/error-in-resource-configuration-while-using-resource-query-function-with-angu">Error in resource configuration while using $resource.query() function with AngularJS/Rails</a></p>
  
  <p>That says I should add this to my resource declaration:</p>
  
  <pre><code>'query': {method: 'GET', isArray: false }
  </code></pre>
  
  <p>Problem being I have no idea where I am supposed to add this, or even if this is the problem I'm having?</p>
  
  <p>EDIT:</p>
  
  <pre><code>bulletinApp.factory('Post', ['$resource', function($resource) {
    return $resource('/posts', {'query': {method: 'GET', isArray: false}});
  }]);
  </code></pre>
  
  <p>After this I am still receiving the error. Also in the tutorial, there was no need for this and I've followed it pretty much to a tee, why would the get method be getting an object instead of an array?</p>