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');
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<Object>} 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;
};
/**