Skip to content

Instantly share code, notes, and snippets.

@takuhou
Created February 6, 2015 14:39
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 takuhou/d6e57636e4b562a99fff to your computer and use it in GitHub Desktop.
Save takuhou/d6e57636e4b562a99fff to your computer and use it in GitHub Desktop.
var TestService = angular.module('TestService',['ngResource']);
TestService.factory('Test',['$resource',function ($resource) {
return $resource('http://localhost/api/test/:id',{},{
query: {method: 'GET', isArray: true},
show: {method: 'GET'},
save: {method: 'POST'},
update: {method: 'PUT'},
remove: {method: 'DELET'}
});
}
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment