(js) Improve Angular modules initialization
This commit is contained in:
parent
7e10cff395
commit
d3a233b222
|
@ -51,7 +51,16 @@
|
||||||
return Message; // return constructor
|
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')
|
angular.module('SOGo.MailerUI')
|
||||||
.factory('Message', Message.$factory);
|
.factory('Message', Message.$factory);
|
||||||
|
|
||||||
|
|
|
@ -69,6 +69,14 @@
|
||||||
return new Preferences(); // return unique instance
|
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 */
|
/* Factory registration in Angular module */
|
||||||
angular.module('SOGo.PreferencesUI')
|
angular.module('SOGo.PreferencesUI')
|
||||||
.factory('Preferences', Preferences.$factory);
|
.factory('Preferences', Preferences.$factory);
|
||||||
|
|
Loading…
Reference in a new issue