(modulesToLoad)
| 4061 | // Module Loading |
| 4062 | //////////////////////////////////// |
| 4063 | function loadModules(modulesToLoad) { |
| 4064 | var runBlocks = [], moduleFn; |
| 4065 | forEach(modulesToLoad, function(module) { |
| 4066 | if (loadedModules.get(module)) return; |
| 4067 | loadedModules.put(module, true); |
| 4068 | |
| 4069 | function runInvokeQueue(queue) { |
| 4070 | var i, ii; |
| 4071 | for (i = 0, ii = queue.length; i < ii; i++) { |
| 4072 | var invokeArgs = queue[i], |
| 4073 | provider = providerInjector.get(invokeArgs[0]); |
| 4074 | |
| 4075 | provider[invokeArgs[1]].apply(provider, invokeArgs[2]); |
| 4076 | } |
| 4077 | } |
| 4078 | |
| 4079 | try { |
| 4080 | if (isString(module)) { |
| 4081 | moduleFn = angularModule(module); |
| 4082 | runBlocks = runBlocks.concat(loadModules(moduleFn.requires)).concat(moduleFn._runBlocks); |
| 4083 | runInvokeQueue(moduleFn._invokeQueue); |
| 4084 | runInvokeQueue(moduleFn._configBlocks); |
| 4085 | } else if (isFunction(module)) { |
| 4086 | runBlocks.push(providerInjector.invoke(module)); |
| 4087 | } else if (isArray(module)) { |
| 4088 | runBlocks.push(providerInjector.invoke(module)); |
| 4089 | } else { |
| 4090 | assertArgFn(module, 'module'); |
| 4091 | } |
| 4092 | } catch (e) { |
| 4093 | if (isArray(module)) { |
| 4094 | module = module[module.length - 1]; |
| 4095 | } |
| 4096 | if (e.message && e.stack && e.stack.indexOf(e.message) == -1) { |
| 4097 | // Safari & FF's stack traces don't contain error.message content |
| 4098 | // unlike those of Chrome and IE |
| 4099 | // So if stack doesn't contain message, we create a new string that contains both. |
| 4100 | // Since error.stack is read-only in Safari, I'm overriding e and not e.stack here. |
| 4101 | /* jshint -W022 */ |
| 4102 | e = e.message + '\n' + e.stack; |
| 4103 | } |
| 4104 | throw $injectorMinErr('modulerr', "Failed to instantiate module {0} due to:\n{1}", |
| 4105 | module, e.stack || e.message || e); |
| 4106 | } |
| 4107 | }); |
| 4108 | return runBlocks; |
| 4109 | } |
| 4110 | |
| 4111 | //////////////////////////////////// |
| 4112 | // internal Injector |
no test coverage detected