summaryrefslogtreecommitdiff
path: root/static/scripts/app/services.js
diff options
context:
space:
mode:
authorMichaël Ball <michael.ball@gmail.com>2014-12-28 12:24:22 +0000
committerMichaël Ball <michael.ball@gmail.com>2015-11-27 20:02:04 +0000
commit75beec91a8526fbbc0a90134140b9dff6af15c0c (patch)
tree02414e46da3e08000384c40c27b7aab9748de0fe /static/scripts/app/services.js
parenta2964845e3c03b9cf5f01583f53f7553c7d67caf (diff)
Initial frontend work
Diffstat (limited to 'static/scripts/app/services.js')
-rw-r--r--static/scripts/app/services.js97
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
+ }
+ });
+}]);