index.module.ts
2.84 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/**
* @ngdoc service
* @name NoosferoApp
* @description
* The main NoosferoApp module class. It provide helper static methods used by
* the module to initialize the application.
*/
export class NoosferoApp {
/**
* @ngdoc property
* @name appName
* @propertyOf NoosferoApp
* @returns {string} the name of this application ('noosferoApp')
*/
static appName: string = "noosferoApp";
/**
* @ngdoc property
* @name angularModule
* @propertyOf NoosferoApp
* @returns {any} all the modules installed for this application
*/
static angularModule: any;
/**
* @ngdoc method
* @name addConfig
* @methodOf NoosferoApp
* @param {Function} configFunc the configuration function to add
* @descprition adds a configuration function to
* the {@link NoosferoApp#angularModule}
*/
static addConfig(configFunc: Function) {
NoosferoApp.angularModule.config(configFunc);
}
/**
* @ngdoc method
* @name addConstants
* @methodOf NoosferoApp
* @param {string} constantName the constant name
* @param {any} value the constant value
* @description adds a constant to the {@link NoosferoApp#angularModule}
*/
static addConstants(constantName: string, value: any) {
NoosferoApp.angularModule.constant(constantName, value);
}
/**
* @ngdoc method
* @name addService
* @methodOf NoosferoApp
* @param {string} serviceName the service name
* @param {any} value the service value
* @description adds a service to the {@link NoosferoApp#angularModule}
*/
static addService(serviceName: string, value: any) {
NoosferoApp.angularModule.service(serviceName, value);
}
/**
* @ngdoc method
* @name addFactory
* @methodOf NoosferoApp
* @param {string} factoryName the factory name
* @param {any} value the factory value
* @description adds a factory to the {@link NoosferoApp#angularModule}
*/
static addFactory(factoryName: string, value: any) {
NoosferoApp.angularModule.factory(factoryName, value);
}
/**
* @ngdoc method
* @name addController
* @methodOf NoosferoApp
* @param {string} controllerName the controller name
* @param {any} value the controller value
* @description adds a controller to the {@link NoosferoApp#angularModule}
*/
static addController(controllerName: string, value: any) {
NoosferoApp.angularModule.controller(controllerName, value);
}
/**
* @ngdoc method
* @name run
* @methodOf NoosferoApp
* @param {Function} runFunction the function to execute
* @description runs a function using the {@link NoosferoApp#angularModule}
*/
static run(runFunction: Function) {
NoosferoApp.angularModule.run(runFunction);
}
}