MCPcopy Create free account
hub / github.com/EricSimons/ionic-course / getService

Function getService

code/songhop/www/lib/angular/angular.js:4117–4138  ·  view source on GitHub ↗
(serviceName, caller)

Source from the content-addressed store, hash-verified

4115 function createInternalInjector(cache, factory) {
4116
4117 function getService(serviceName, caller) {
4118 if (cache.hasOwnProperty(serviceName)) {
4119 if (cache[serviceName] === INSTANTIATING) {
4120 throw $injectorMinErr('cdep', 'Circular dependency found: {0}',
4121 serviceName + ' <- ' + path.join(' <- '));
4122 }
4123 return cache[serviceName];
4124 } else {
4125 try {
4126 path.unshift(serviceName);
4127 cache[serviceName] = INSTANTIATING;
4128 return cache[serviceName] = factory(serviceName, caller);
4129 } catch (err) {
4130 if (cache[serviceName] === INSTANTIATING) {
4131 delete cache[serviceName];
4132 }
4133 throw err;
4134 } finally {
4135 path.shift();
4136 }
4137 }
4138 }
4139
4140 function invoke(fn, self, locals, serviceName) {
4141 if (typeof locals === 'string') {

Callers 1

invokeFunction · 0.70

Calls 1

factoryFunction · 0.70

Tested by

no test coverage detected