(js) Improve Angular modules initialization

pull/91/head
Francis Lachapelle 2015-07-29 15:16:43 -04:00
parent 7e10cff395
commit d3a233b222
2 changed files with 18 additions and 1 deletions

View File

@ -51,7 +51,16 @@
return Message; // return constructor
}];
/* Factory registration in Angular module */
/**
* @module SOGo.MailerUI
* @desc Factory registration of Message in Angular module.
*/
try {
angular.module('SOGo.MailerUI');
}
catch(e) {
angular.module('SOGo.MailerUI', ['SOGo.Common']);
}
angular.module('SOGo.MailerUI')
.factory('Message', Message.$factory);

View File

@ -69,6 +69,14 @@
return new Preferences(); // return unique instance
}];
/* Initialize module if necessary */
try {
angular.module('SOGo.PreferencesUI');
}
catch(e) {
angular.module('SOGo.PreferencesUI', ['SOGo.Common']);
}
/* Factory registration in Angular module */
angular.module('SOGo.PreferencesUI')
.factory('Preferences', Preferences.$factory);