MCPcopy Create free account
hub / github.com/angular-ui/ui-grid / invoke

Function invoke

lib/test/angular/1.7.0/angular.js:5079–5098  ·  view source on GitHub ↗
(fn, self, locals, serviceName)

Source from the content-addressed store, hash-verified

5077 }
5078
5079 function invoke(fn, self, locals, serviceName) {
5080 if (typeof locals === 'string') {
5081 serviceName = locals;
5082 locals = null;
5083 }
5084
5085 var args = injectionArgs(fn, locals, serviceName);
5086 if (isArray(fn)) {
5087 fn = fn[fn.length - 1];
5088 }
5089
5090 if (!isClass(fn)) {
5091 // http://jsperf.com/angularjs-invoke-apply-vs-switch
5092 // #5388
5093 return fn.apply(self, args);
5094 } else {
5095 args.unshift(null);
5096 return new (Function.prototype.bind.apply(fn, args))();
5097 }
5098 }
5099
5100
5101 function instantiate(Type, locals, serviceName) {

Callers

nothing calls this directly

Calls 3

injectionArgsFunction · 0.70
isArrayFunction · 0.70
isClassFunction · 0.70

Tested by

no test coverage detected