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

Function getService

test/angular/1.2/angular.js:3920–3941  ·  view source on GitHub ↗
(serviceName)

Source from the content-addressed store, hash-verified

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

Callers 1

invokeFunction · 0.70

Calls 1

factoryFunction · 0.70

Tested by

no test coverage detected