From 95ad15b0dddd7c28f5f2541d113ae1391fccacec Mon Sep 17 00:00:00 2001 From: Tankred Hase Date: Wed, 19 Nov 2014 15:15:57 +0100 Subject: [PATCH] Export account service as common.js module --- src/js/service/account.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/js/service/account.js b/src/js/service/account.js index 6ee7fba..6b87b47 100644 --- a/src/js/service/account.js +++ b/src/js/service/account.js @@ -2,11 +2,12 @@ var ngModule = angular.module('woServices'); ngModule.service('account', Account); +module.exports = Account; -var Email = require('./email'); - -function Account() { - this._emailDAOs = []; +function Account(email, outbox) { + this._emailDAOs = [email]; + this._outboxes = [outbox]; + this._accounts = undefined; } /** @@ -14,9 +15,11 @@ function Account() { * @return {Array} The account objects containing folder and message objects */ Account.prototype.list = function() { - return this._emailDAOs.map(function(emailDao) { + this._accounts = this._emailDAOs.map(function(emailDao) { return emailDao._account; }); + + return this._accounts; }; /**