MCPcopy Index your code
hub / github.com/angular-ui/ui-router / invoke

Function invoke

test/angular/1.2/angular.js:3943–3968  ·  view source on GitHub ↗
(fn, self, locals)

Source from the content-addressed store, hash-verified

3941 }
3942
3943 function invoke(fn, self, locals){
3944 var args = [],
3945 $inject = annotate(fn),
3946 length, i,
3947 key;
3948
3949 for(i = 0, length = $inject.length; i < length; i++) {
3950 key = $inject[i];
3951 if (typeof key !== 'string') {
3952 throw $injectorMinErr('itkn',
3953 'Incorrect injection token! Expected service name as string, got {0}', key);
3954 }
3955 args.push(
3956 locals && locals.hasOwnProperty(key)
3957 ? locals[key]
3958 : getService(key)
3959 );
3960 }
3961 if (isArray(fn)) {
3962 fn = fn[length];
3963 }
3964
3965 // http://jsperf.com/angularjs-invoke-apply-vs-switch
3966 // #5388
3967 return fn.apply(self, args);
3968 }
3969
3970 function instantiate(Type, locals) {
3971 var Constructor = function() {},

Callers 1

instantiateFunction · 0.70

Calls 3

isArrayFunction · 0.85
annotateFunction · 0.70
getServiceFunction · 0.70

Tested by

no test coverage detected