You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 21, 2025. It is now read-only.
By default, any constants specified in the ```resolve``` object will be attached to the module specified in the ```module``` option. If you have a need to attach constants to different modules then this can be achieved by using ```moduleResolves```:
76
+
77
+
```js
78
+
window.deferredBootstrapper.bootstrap({
79
+
element:document.body,
80
+
module:'myApp',
81
+
moduleResolves: [
82
+
{
83
+
module:'myApp.settings',
84
+
resolve: {
85
+
CONSTANT_ONE: ['$http', function ($http) {
86
+
return$http.get();
87
+
}],
88
+
CONSTANT_TWO: ['$http', function ($http) {
89
+
return$http.get();
90
+
}]
91
+
}
92
+
},
93
+
{
94
+
module:'myApp.moreSettings',
95
+
resolve: {
96
+
CONSTANT_THREE: ['$http', function ($http) {
97
+
return$http.get();
98
+
}]
99
+
}
100
+
}
101
+
]
102
+
})
103
+
```
104
+
105
+
In the above example, ```CONSTANT_ONE``` and ```CONSTANT_TWO``` will be added to the ```'myApp.settings'``` module and ```CONSTANT_THREE``` will be added to the ```'myApp.moreSettings'``` module. There are no limits on how many ```moduleResolve``` objects you create and also no limit on the number of constants per ```moduleResolve```
106
+
107
+
**Note** that only ```resolve``` or ```moduleResolves``` can be used - using both in the same configuration will throw an exception
108
+
74
109
## Custom injector modules
75
110
By default, the injector that calls your resolve functions only provides the services from the AngularJS core module (ng). If you have a use case where you want to use one of your existing services to get configuration at bootstrap time, you can specify which modules should be made available and inject services from those modules in the resolve function. An example is below:
0 commit comments