/
config.js
82 lines (74 loc) · 2.34 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
'use strict';
import ngreact from 'ngreact';
// Init the application configuration module for AngularJS application
// eslint-disable-next-line no-unused-vars
var AppConfig = (function () {
// Init module configuration options
// When testing, `window.env` is undefined, thus default to 'test'
// eslint-disable-next-line angular/window-service
var appEnv = process.env.NODE_ENV || 'test';
var appModuleName = 'trustroots';
var appModuleVendorDependencies = [
ngreact.name,
'ngAria',
'ngResource',
'ngAnimate',
'ngTouch',
'ngSanitize',
'ngMessageFormat',
'angulartics',
'ui.router',
'ui.bootstrap.dateparser',
'ui.bootstrap.buttons',
'ui.bootstrap.collapse',
'ui.bootstrap.dropdown',
'ui.bootstrap.modal',
'ui.bootstrap.popover',
'ui.bootstrap.progressbar',
'ui.bootstrap.tabs',
'ui.bootstrap.tooltip',
'ui.bootstrap.typeahead',
'ui.bootstrap.datepicker',
'angularMoment',
'nemLogging',
'ui-leaflet',
'ngFileUpload',
'zumba.angular-waypoints',
'localytics.directives',
'angular-loading-bar',
'trTrustpass',
'angular-mailcheck',
'angular-locker',
'angular-confirm',
'angularGrid'
];
/**
* Load different service dependency for Angulartics depending on environment
* @link https://github.com/angulartics/angulartics
*/
if (appEnv === 'production') {
// @link https://github.com/angulartics/angulartics-google-analytics
appModuleVendorDependencies.push('angulartics.google.analytics');
} else if (appEnv === 'development') {
// @link https://github.com/angulartics/angulartics/blob/master/src/angulartics-debug.js
appModuleVendorDependencies.push('angulartics.debug');
} else {
// For "test" environment
// See `testutils/angulartics-null.testutil.js`
appModuleVendorDependencies.push('angulartics.null');
}
// Add a new vertical module
var registerModule = function (moduleName, dependencies) {
// Create angular module
angular.module(moduleName, dependencies || []);
// Add the module to the AngularJS configuration file
angular.module(appModuleName).requires.push(moduleName);
};
return {
appEnv: appEnv,
appModuleName: appModuleName,
appModuleVendorDependencies: appModuleVendorDependencies,
registerModule: registerModule
};
}());
module.exports = AppConfig;