You are using a smaller version of angularjs, so you should use an array notation . Just enter the required services into the array, followed by the function:
angular.module('user', ['ngResource']). factory('User', ['$resource', function($resource) { var User= $resource('/user/:id', { update: { method: 'PUT' } }); User.prototype.update = function(cb) { return User.update({ id: this.id }, angular.extend({}, this, { _id: undefined }), cb); }); }]);
Note. The same applies to your directives, controllers, ...
source share