MCPcopy Create free account
hub / github.com/OpenReservation/OpenReservation / instantiate

Function instantiate

OpenReservation/wwwroot/Scripts/angular.js:4625–4633  ·  view source on GitHub ↗
(Type, locals, serviceName)

Source from the content-addressed store, hash-verified

4623 }
4624
4625 function instantiate(Type, locals, serviceName) {
4626 // Check if Type is annotated and use just the given function at n-1 as parameter
4627 // e.g. someModule.factory('greeter', ['$window', function(renamed$window) {}]);
4628 var ctor = (isArray(Type) ? Type[Type.length - 1] : Type);
4629 var args = injectionArgs(Type, locals, serviceName);
4630 // Empty object at position 0 is ignored for invocation with `new`, but required.
4631 args.unshift(null);
4632 return new (Function.prototype.bind.apply(ctor, args))();
4633 }
4634
4635 return {
4636 invoke: invoke,

Callers

nothing calls this directly

Calls 1

injectionArgsFunction · 0.85

Tested by

no test coverage detected