MCPcopy Index your code
hub / github.com/angular-ui/ui-router / getService

Function getService

test/angular/1.3/angular.js:4167–4188  ·  view source on GitHub ↗
(serviceName, caller)

Source from the content-addressed store, hash-verified

4165 function createInternalInjector(cache, factory) {
4166
4167 function getService(serviceName, caller) {
4168 if (cache.hasOwnProperty(serviceName)) {
4169 if (cache[serviceName] === INSTANTIATING) {
4170 throw $injectorMinErr('cdep', 'Circular dependency found: {0}',
4171 serviceName + ' <- ' + path.join(' <- '));
4172 }
4173 return cache[serviceName];
4174 } else {
4175 try {
4176 path.unshift(serviceName);
4177 cache[serviceName] = INSTANTIATING;
4178 return cache[serviceName] = factory(serviceName, caller);
4179 } catch (err) {
4180 if (cache[serviceName] === INSTANTIATING) {
4181 delete cache[serviceName];
4182 }
4183 throw err;
4184 } finally {
4185 path.shift();
4186 }
4187 }
4188 }
4189
4190 function invoke(fn, self, locals, serviceName) {
4191 if (typeof locals === 'string') {

Callers 1

invokeFunction · 0.70

Calls 1

factoryFunction · 0.70

Tested by

no test coverage detected