From 75beec91a8526fbbc0a90134140b9dff6af15c0c Mon Sep 17 00:00:00 2001 From: Michaƫl Ball Date: Sun, 28 Dec 2014 12:24:22 +0000 Subject: Initial frontend work --- static/scripts/app/services.js | 97 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 static/scripts/app/services.js (limited to 'static/scripts/app/services.js') 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 + } + }); +}]); -- cgit v1.2.3