Skip to content

Instantly share code, notes, and snippets.

@bora89
Created December 9, 2016 09:26
Show Gist options
  • Select an option

  • Save bora89/1b27d091f843aabcd2866500b1d08e0d to your computer and use it in GitHub Desktop.

Select an option

Save bora89/1b27d091f843aabcd2866500b1d08e0d to your computer and use it in GitHub Desktop.
AngularJS $resource usage (custom PUT) non-GET "class" actions: Resource.action([parameters], postData, [success], [error])
var res = $resource(ENV.API_URL+'/playlist/:id', null, {
'update': { method: 'PUT', params: {id: '@id'} }
});
// usage
res.update({ id: id }, {name: name });
// name will be in the Payload, id - in the URI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment