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

Function instantiate

lib/test/angular/1.5.0/angular.js:4612–4620  ·  view source on GitHub ↗
(Type, locals, serviceName)

Source from the content-addressed store, hash-verified

4610
4611
4612 function instantiate(Type, locals, serviceName) {
4613 // Check if Type is annotated and use just the given function at n-1 as parameter
4614 // e.g. someModule.factory('greeter', ['$window', function(renamed$window) {}]);
4615 var ctor = (isArray(Type) ? Type[Type.length - 1] : Type);
4616 var args = injectionArgs(Type, locals, serviceName);
4617 // Empty object at position 0 is ignored for invocation with `new`, but required.
4618 args.unshift(null);
4619 return new (Function.prototype.bind.apply(ctor, args))();
4620 }
4621
4622
4623 return {

Callers

nothing calls this directly

Calls 2

injectionArgsFunction · 0.70
isArrayFunction · 0.50

Tested by

no test coverage detected