Created
August 4, 2018 02:57
-
-
Save crossdjinn/8ce36d93ca908667b1ef309b2c393f20 to your computer and use it in GitHub Desktop.
Angular (1.6.8) example of "TRACKS" API
This file contains 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
angular.module('app',[]) | |
.factory('TRACKS', ['$resource', | |
function($resource) { | |
return $resource('/api/tracks/:id', {id: '@_id'}, { | |
'query': {method:'GET', isArray:true}, | |
'get': {method:'GET'}, | |
'update': {method:'PUT'}, | |
'save': {method:'POST'}, | |
'remove': {method:'DELETE'}, | |
'delete': {method:'DELETE'} | |
}); | |
} | |
]); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment