I'm using a $resource in Angular, and have set up the resource like this:
angular.module('MyApp')
.factory('Appointment', function($resource){
    return $resource('/api/admin/:id', { id: "@_id" }, {
         query: {method:'GET', isArray:true}
    });
})
Now, when I use this resource in one controller (adminController) it works ok:
angular.module('MyApp')
.controller('adminController', ['$scope', 'Appointment', '$state', '$rootScope' , '$stateParams', '$log', '$modal','uiGmapGoogleMapApi',  function($scope, Appointment, $state, $rootScope, $stateParams, $log, $modal, uiGmapGoogleMapApi) {
$scope.apps  = Appointment.query();
}])
but when I try to use it in another one (DetailCtrl) i get the above error:
angular.module('MyApp')
.controller('DetailCtrl', ['$scope', 'Appointment', '$state', '$rootScope' , '$stateParams', '$log', '$modal', 'uiGmapGoogleMapApi', function($scope, Appointment, $state, $rootScope, $stateParams, $log, $modal, uiGmapGoogleMapApi) {
$scope.detail = Appointment.query({id: $stateParams.id})
}])
can anyone explain what it going on? I'm getting this error:
Error: [$resource:badcfg] Error in resource configuration for action `query`. Expected response to contain an array but got an object
