title: how to fix Expected response to contain an array but got an object ANgular js
body: <p>i am new one so difficult to getting this error using resource module after calling service.
  can any one modify my mistake in code where i am getting wrong or just modified that pieace of which needs to rectify thanx must be appreciated.</p>
  
  <p><strong>Format Of data Coming:-</strong></p>
  
  <pre><code>[
      brands: Array[1]
      0: Object
      __v: 0
      _id: "5251a4a34f232fc3902"
      account_id: "525072320e32971b"
      name: "Fruits"
      __proto__: Object
      1: Object
      length: 2
  
      categories: Array[1]
          0: Object
          __v: 0
          _id: "5251a4a34f2323fc3902"
          account_id: "5250723230e32971b"
          name: "Fruits"
          __proto__: Object
          1: Object
          length: 2
  ]
  </code></pre>
  
  <p><strong>Error:-</strong></p>
  
  <p>[$resource:badcfg] Error in resource configuration. Expected response to contain an array but got an object</p>
  
  <p><strong>itmsFormView.html</strong></p>
  
  <pre><code>&lt;select class="form-control" ng-model="item.brand_id" id="itemBrand" &gt;
      &lt;option value=""&gt;Select Brand&lt;/option&gt;
      &lt;option ng-repeat="brand in brands" value="{{brand.brand_id}}"&gt;{{brand.name}}  &lt;/option&gt;
  &lt;/select&gt;
  
  
  
   &lt;select class="form-control" ng-model="item.category_id" id="itemCategory"&gt;           
  
  &lt;option value=""&gt;Select Category&lt;/option&gt;
         &lt;option ng-repeat="category in categories" value="{{category.brand_id}}"&gt;{{category.name}}&lt;/option&gt;
      &lt;/select&gt;
  </code></pre>
  
  <p><strong>ItemsService.js</strong></p>
  
  <pre><code>app.factory('itemService', function ($resource) {
      return {
          getCategoryAndBrand   :  $resource("/user/categories_brands" ,{},{ TypeGetCategoryAndBrand:{method: 'get', isArray:true}})
      };
  });
  </code></pre>
  
  <p><strong>ItemsController.js</strong></p>
  
  <pre><code>app.controller('itemsFormController', function ($rootScope, $scope, itemService, $location, $cookies, $routeParams) {
          itemService.getCategoryAndBrand.TypeGetCategoryAndBrand({}, function(response){
                  console.log(response);
  
              },function(errorResponse){
                  console.log(errorResponse);
              }
          );  
  });
  </code></pre>