2 // These variables are provided by the server in karaf distribution.
3 // The path of all *.module.js go here. They are RequireJs module.
4 // You can uncomment them only for development purpose if you are not using
5 //karaf based dlux deployment
11 'angular-translate-loader-static-files',
12 'angular-translate-loader-partial',
15 'angular-css-injector',
19 'app/core/core.module',
20 'app/node/nodes.module',
21 'app/topology/topology.module',
22 'common/login/login.module',
25 'app/yangvisualizer/yangvisualizer.module',
26 'common/sigmatopology/sigmatopology.module',
27 'common/navigation/navigation.module',
28 'common/topbar/topbar.module',
29 'common/layout/layout.module',
30 'common/config/env.module'
33 // The name of all angularjs module
37 'pascalprecht.translate',
39 'angular.css.injector',
47 'app.common.sigmatopology',
51 //--------------------\\
55 define(module, function(angular) {
60 orig_angular = angular,
61 app = angular.module('app', []);
63 angular.extend(dlux_angular, orig_angular);
65 dlux_angular.module = function(name, deps) {
66 var module = orig_angular.module(name, deps);
71 window.angular = dlux_angular; // backward compatibility
73 // The overal config he is done here.
74 app.config(function ($urlRouterProvider, $ocLazyLoadProvider, $translateProvider, $translatePartialLoaderProvider, $controllerProvider, $compileProvider, $provide, $filterProvider, cssInjectorProvider) {
76 $urlRouterProvider.otherwise("/topology"); // set the default route
78 cssInjectorProvider.setSinglePageMode(true); // remove all added CSS files when the page change
80 // set the ocLazyLoader to output error and use requirejs as loader
81 $ocLazyLoadProvider.config({
86 $translateProvider.useLoader('$translatePartialLoader', {
87 urlTemplate: '/src/{part}-{lang}.json'
90 $translatePartialLoaderProvider.addPart('../assets/data/locale');
91 $translateProvider.preferredLanguage('en_US');
92 $translateProvider.useSanitizeValueStrategy('escape');
94 // the only way to add a dynamic module
96 controller : $controllerProvider.register,
97 directive : $compileProvider.directive,
98 factory : $provide.factory,
99 filter: $filterProvider.register,
100 service : $provide.service
104 angular.extend(app.register, register);
107 /* --- define vs require war ---
108 * From my understanding, we use require when
109 * we want to load a dependency and run it. Define
110 * is only to define the dependency for a module.
112 require(deps, function() {
113 angular.element(document).ready(function() {
114 angular.bootstrap(document, e).invoke(function() {
115 preboot.forEach(function(m) {
116 angular.extend(m, register);
118 console.log('bootstrap done (: ');