MCPcopy
hub / github.com/angular-ui/ui-router / getService

Function getService

test/angular/1.6/angular.js:5047–5069  ·  view source on GitHub ↗
(serviceName, caller)

Source from the content-addressed store, hash-verified

5045 function createInternalInjector(cache, factory) {
5046
5047 function getService(serviceName, caller) {
5048 if (cache.hasOwnProperty(serviceName)) {
5049 if (cache[serviceName] === INSTANTIATING) {
5050 throw $injectorMinErr('cdep', 'Circular dependency found: {0}',
5051 serviceName + ' <- ' + path.join(' <- '));
5052 }
5053 return cache[serviceName];
5054 } else {
5055 try {
5056 path.unshift(serviceName);
5057 cache[serviceName] = INSTANTIATING;
5058 cache[serviceName] = factory(serviceName, caller);
5059 return cache[serviceName];
5060 } catch (err) {
5061 if (cache[serviceName] === INSTANTIATING) {
5062 delete cache[serviceName];
5063 }
5064 throw err;
5065 } finally {
5066 path.shift();
5067 }
5068 }
5069 }
5070
5071
5072 function injectionArgs(fn, locals, serviceName) {

Callers 1

injectionArgsFunction · 0.70

Calls 1

factoryFunction · 0.70

Tested by

no test coverage detected