Skip to content

Instantly share code, notes, and snippets.

@petebacondarwin
Created March 23, 2012 13:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save petebacondarwin/2170671 to your computer and use it in GitHub Desktop.
Save petebacondarwin/2170671 to your computer and use it in GitHub Desktop.
angular.module('myApp', []).service('Partners', function($resource) {
return $resource({ ull:myUrl},function(Partners, rsrcMethod){
Partners.externalize = function(self) {
var myself = angular.copy(self);
return {data: myself};
};
Partners.query = rsrcMethod('', {response: 'response.data.response.data'});
Partners.$save: rsrcMethod('self', { method: 'PUT', request: true, url: '{{url}}{{self.id}}' })
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment