mirror of
https://github.com/moparisthebest/mail
synced 2024-11-29 20:32: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');
|
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;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user