(js) Improve Angular modules initialization
parent
7e10cff395
commit
d3a233b222
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue