1
0
mirror of https://github.com/moparisthebest/mail synced 2024-11-26 10:52:17 -05:00

Export account service as common.js module

This commit is contained in:
Tankred Hase 2014-11-19 15:15:57 +01:00
parent 41879bf5b3
commit 95ad15b0dd

View File

@ -2,11 +2,12 @@
var ngModule = angular.module('woServices'); var ngModule = angular.module('woServices');
ngModule.service('account', Account); ngModule.service('account', Account);
module.exports = Account;
var Email = require('./email'); function Account(email, outbox) {
this._emailDAOs = [email];
function Account() { this._outboxes = [outbox];
this._emailDAOs = []; this._accounts = undefined;
} }
/** /**
@ -14,9 +15,11 @@ function Account() {
* @return {Array<Object>} The account objects containing folder and message objects * @return {Array<Object>} The account objects containing folder and message objects
*/ */
Account.prototype.list = function() { Account.prototype.list = function() {
return this._emailDAOs.map(function(emailDao) { this._accounts = this._emailDAOs.map(function(emailDao) {
return emailDao._account; return emailDao._account;
}); });
return this._accounts;
}; };
/** /**