(modulesToLoad)
| 4111 | // Module Loading |
| 4112 | //////////////////////////////////// |
| 4113 | function loadModules(modulesToLoad) { |
| 4114 | var runBlocks = [], moduleFn; |
| 4115 | forEach(modulesToLoad, function(module) { |
| 4116 | if (loadedModules.get(module)) return; |
| 4117 | loadedModules.put(module, true); |
| 4118 | |
| 4119 | function runInvokeQueue(queue) { |
| 4120 | var i, ii; |
| 4121 | for (i = 0, ii = queue.length; i < ii; i++) { |
| 4122 | var invokeArgs = queue[i], |
| 4123 | provider = providerInjector.get(invokeArgs[0]); |
| 4124 | |
| 4125 | provider[invokeArgs[1]].apply(provider, invokeArgs[2]); |
| 4126 | } |
| 4127 | } |
| 4128 | |
| 4129 | try { |
| 4130 | if (isString(module)) { |
| 4131 | moduleFn = angularModule(module); |
| 4132 | runBlocks = runBlocks.concat(loadModules(moduleFn.requires)).concat(moduleFn._runBlocks); |
| 4133 | runInvokeQueue(moduleFn._invokeQueue); |
| 4134 | runInvokeQueue(moduleFn._configBlocks); |
| 4135 | } else if (isFunction(module)) { |
| 4136 | runBlocks.push(providerInjector.invoke(module)); |
| 4137 | } else if (isArray(module)) { |
| 4138 | runBlocks.push(providerInjector.invoke(module)); |
| 4139 | } else { |
| 4140 | assertArgFn(module, 'module'); |
| 4141 | } |
| 4142 | } catch (e) { |
| 4143 | if (isArray(module)) { |
| 4144 | module = module[module.length - 1]; |
| 4145 | } |
| 4146 | if (e.message && e.stack && e.stack.indexOf(e.message) == -1) { |
| 4147 | // Safari & FF's stack traces don't contain error.message content |
| 4148 | // unlike those of Chrome and IE |
| 4149 | // So if stack doesn't contain message, we create a new string that contains both. |
| 4150 | // Since error.stack is read-only in Safari, I'm overriding e and not e.stack here. |
| 4151 | /* jshint -W022 */ |
| 4152 | e = e.message + '\n' + e.stack; |
| 4153 | } |
| 4154 | throw $injectorMinErr('modulerr', "Failed to instantiate module {0} due to:\n{1}", |
| 4155 | module, e.stack || e.message || e); |
| 4156 | } |
| 4157 | }); |
| 4158 | return runBlocks; |
| 4159 | } |
| 4160 | |
| 4161 | //////////////////////////////////// |
| 4162 | // internal Injector |
no test coverage detected