MCPcopy Create free account
hub / github.com/bclinkinbeard/angular / getService

Function getService

test/fixtures/foo.js:3919–3940  ·  view source on GitHub ↗
(serviceName)

Source from the content-addressed store, hash-verified

3917 function createInternalInjector(cache, factory) {
3918
3919 function getService(serviceName) {
3920 if (cache.hasOwnProperty(serviceName)) {
3921 if (cache[serviceName] === INSTANTIATING) {
3922 throw $injectorMinErr('cdep', 'Circular dependency found: {0}',
3923 serviceName + ' <- ' + path.join(' <- '));
3924 }
3925 return cache[serviceName];
3926 } else {
3927 try {
3928 path.unshift(serviceName);
3929 cache[serviceName] = INSTANTIATING;
3930 return cache[serviceName] = factory(serviceName);
3931 } catch (err) {
3932 if (cache[serviceName] === INSTANTIATING) {
3933 delete cache[serviceName];
3934 }
3935 throw err;
3936 } finally {
3937 path.shift();
3938 }
3939 }
3940 }
3941
3942 function invoke(fn, self, locals){
3943 var args = [],

Callers 1

invokeFunction · 0.85

Calls 1

factoryFunction · 0.85

Tested by

no test coverage detected