MCPcopy Create free account
hub / github.com/cafebazaar/blacksmith / getService

Function getService

web/static/bower_components/angular/angular.js:4426–4447  ·  view source on GitHub ↗
(serviceName, caller)

Source from the content-addressed store, hash-verified

4424 function createInternalInjector(cache, factory) {
4425
4426 function getService(serviceName, caller) {
4427 if (cache.hasOwnProperty(serviceName)) {
4428 if (cache[serviceName] === INSTANTIATING) {
4429 throw $injectorMinErr('cdep', 'Circular dependency found: {0}',
4430 serviceName + ' <- ' + path.join(' <- '));
4431 }
4432 return cache[serviceName];
4433 } else {
4434 try {
4435 path.unshift(serviceName);
4436 cache[serviceName] = INSTANTIATING;
4437 return cache[serviceName] = factory(serviceName, caller);
4438 } catch (err) {
4439 if (cache[serviceName] === INSTANTIATING) {
4440 delete cache[serviceName];
4441 }
4442 throw err;
4443 } finally {
4444 path.shift();
4445 }
4446 }
4447 }
4448
4449 function invoke(fn, self, locals, serviceName) {
4450 if (typeof locals === 'string') {

Callers 1

invokeFunction · 0.85

Calls 1

factoryFunction · 0.85

Tested by

no test coverage detected