Created
December 9, 2016 09:26
-
-
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])
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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