diff options
Diffstat (limited to 'static/scripts/app/services.js')
-rw-r--r-- | static/scripts/app/services.js | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/static/scripts/app/services.js b/static/scripts/app/services.js new file mode 100644 index 0000000..c7cd92b --- /dev/null +++ b/static/scripts/app/services.js @@ -0,0 +1,97 @@ +var mach2Services = angular.module('mach2Services', ['ngResource']); + +mach2Services.factory('Artist', ['$resource', function($resource) { + return $resource('artists/:artistId', {}, { + query: { + method: 'GET' + } + }); +}]); + +mach2Services.factory('ArtistAlbums', ['$resource', function($resource) { + return $resource('artists/:artistId/albums', {}, { + query: { + method: 'GET', + isArray: true + } + }); +}]); + +mach2Services.factory('ArtistSearch', ['$resource', function($resource) { + return $resource('artists/:name', {}, { + query: { + method: 'GET', + isArray: true + } + }); +}]); + +mach2Services.factory('ArtistTracks', ['$resource', function($resource) { + return $resource('artists/:artistId/tracks', {}, { + query: { + method: 'GET', + isArray: true + } + }); +}]); + +mach2Services.factory('Album', ['$resource', function($resource) { + return $resource('albums/:albumId', {}, { + query: { + method: 'GET' + } + }); +}]); + +mach2Services.factory('AlbumArtists', ['$resource', function($resource) { + return $resource('albums/:albumId/artists', {}, { + query: { + method: 'GET', + isArray: true + } + }); +}]); + +mach2Services.factory('AlbumSearch', ['$resource', function($resource) { + return $resource('albums/:name', {}, { + query: { + method: 'GET', + isArray: true, + } + }); +}]); + +mach2Services.factory('AlbumTracks', ['$resource', function($resource) { + return $resource('albums/:albumId/tracks', {}, { + query: { + method: 'GET', + isArray: true + } + }); +}]); + +mach2Services.factory('Track', ['$resource', function($resource) { + return $resource('tracks/:trackId', {}, { + query: { + method: 'GET' + } + }); +}]); + +mach2Services.factory('TrackArtists', ['$resource', function($resource) { + return $resource('tracks/:trackId/artists', {}, { + query: { + method: 'GET' + } + }); +}]); + + +mach2Services.factory('TrackSearch', ['$resource', function($resource) { + return $resource('tracks/:name', {}, { + query: { + method: 'GET', + isArray: true + } + }); +}]); |