Skip to content

Instantly share code, notes, and snippets.

@antillas21
Last active August 29, 2015 14:06
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 antillas21/65a25f3bb8ec92de7125 to your computer and use it in GitHub Desktop.
Save antillas21/65a25f3bb8ec92de7125 to your computer and use it in GitHub Desktop.
ngResource config
(function(){
var app = angular.module('myApp.api', ['ngResource']);
app.factory("Clinic", ['$resource', function($resource) {
var resource = $resource("http://domain.com/api/v1/clinics/:id/:action/",
{
id: "@id",
action: "@action"
},
{
update: { method: 'PUT' },
changePassword: {
method: 'POST',
params: {
action: 'change_password'
}
}
});
return resource;
}]);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment