Merge "Improving readability for Horizon top module structure"

This commit is contained in:
Jenkins 2015-07-08 00:59:58 +00:00 committed by Gerrit Code Review
commit 84aae88057
4 changed files with 42 additions and 10 deletions

View File

@ -24,7 +24,7 @@
<script type="text/javascript">
/* Load angular modules extensions list before we include angular/horizon.js */
var angularModuleExtension = {{ HORIZON_CONFIG.angular_modules|default:"[]"|safe }};
var horizonPlugInModules = {{ HORIZON_CONFIG.angular_modules|default:"[]"|safe }};
</script>
<!-- source files -->

View File

@ -12,18 +12,50 @@
* limitations under the License.
*/
/*global angularModuleExtension*/
/*global horizonPlugInModules*/
(function () {
'use strict';
angular
.module('horizon.app', [
/**
* Library modules - modules defined in third-party libraries, including
* angular's extensions.
*/
var libraryModules = [
'ngCookies'
];
/**
* Horizon's built-in modules, including modules from `framework` components
* and modules from `openstack_dashboard` application core components.
*/
var horizonBuiltInModules = [
'horizon.auth',
'horizon.openstack-service-api',
'horizon.framework',
'hz.dashboard',
'ngCookies'].concat(angularModuleExtension))
'horizon.framework',
'horizon.openstack-service-api'
];
/**
* @ngdoc overview
* @name horizon.app
* @description
*
* # horizon.app
*
* Horizon's application level module depends on modules from three
* sources:
*
* 1) Library modules.
* 2) Horizon's built-in modules.
* 3) Horizon's plug-in modules.
*/
angular
.module('horizon.app', []
.concat(libraryModules)
.concat(horizonBuiltInModules)
.concat(horizonPlugInModules)
)
.constant('horizon.app.conf', {
// Placeholders; updated by Django.

View File

@ -19,7 +19,7 @@
horizon.datepickerLocale = '{{ DATEPICKER_LOCALE }}';
/* Load angular modules extensions list before we include angular/horizon.js */
var angularModuleExtension = {{ HORIZON_CONFIG.angular_modules|default:"[]"|safe }};
var horizonPlugInModules = {{ HORIZON_CONFIG.angular_modules|default:"[]"|safe }};
</script>
{% compress js %}

View File

@ -4,7 +4,7 @@
* Taken from default i18n file provided by Django.
*/
var angularModuleExtension = [];
var horizonPlugInModules = [];
(function (globals) {