How to call an angular resource from a service

How to call an angular resource from a service

I am using Angular 1.1.5 (wait for angular-ui-router to be comptabible
with 1.2.0). I defined a resource and a service:
myapp.factory( 'Monitoring', function($resource) {
return $resource('/webapp/network/v1/cronjobs/:id/:action', { id: '@id'
}, {
status: { method: 'PATCH', headers:{'Content-Type':
'application/json'}, params:{action: 'status'}}
}
);
});
myapp.factory('MonitoringCRUDControllerService', ['Monitoring', '$state',
function(Monitoring, $state) {
return {
query: function() {
var m = new Monitoring();
var promise = m.$query().then(function(response) {
console.log(response);
return response.data;
});
return promise;
},
query1: function() {
var m = new Monitoring();
return m.$query();
},
// Angular 1.2.0 RC
query2: function() {
var m = new Monitoring();
return m.$query().$promise;
}
}
}]);
In my controller I tried query and query1 but both of them returned Cannot
call method 'then' of undefined. The query2 should be the 1.2.0 way to
call the resource.
$scope.refresh = function() {
MonitoringCRUDControllerService.query().then(function(value) {
$scope.myData = value;
});
};