mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-19 21:53:19 +00:00
(js) Improve Angular modules initialization
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user