mirror of
https://github.com/moparisthebest/mail
synced 2024-11-22 08:52:15 -05:00
Export account service as common.js module
This commit is contained in:
parent
41879bf5b3
commit
95ad15b0dd
@ -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;
|
||||
};
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user