Splits all the services into different jamstash.* modules.

That way dependencies are actually visible and can be managed
e.g. Jamstash doesn't depend upon underscore directly anymore, it's just the subsonic service that needs it.
This commit is contained in:
Hyzual 2014-11-06 22:19:55 +01:00
parent a00ca9e12b
commit 1a830d6cef
9 changed files with 74 additions and 40 deletions

View file

@ -1,8 +1,14 @@
'use strict';
/**
* jamstash.model Module
*
* Stores the Index, Artist, Album and Song model. Provides a mapping service that converts between subsonic's
* representation and ours.
*/
angular.module('jamstash.model', ['jamstash.utils'])
var jamstash = angular.module('JamStash');
.service('model', function (utils) {
'use strict';
jamstash.service('model', function (utils) {
this.Index = function (name, artist) {
this.name = name;
this.artist = artist;
@ -49,9 +55,11 @@ jamstash.service('model', function (utils) {
this.description = description;
this.displayName = this.name + " - " + this.album + " - " + this.artist;
};
});
})
.service('map', function ($http, globals, utils, model) {
'use strict';
jamstash.service('map', function ($http, globals, utils, model) {
this.mapArtist = function (data) {
var name = '';
var artist = data.artist;