MCPcopy Create free account
hub / github.com/EricSimons/ionic-course / instantiate

Function instantiate

code/songhop/www/lib/angular/angular.js:4172–4180  ·  view source on GitHub ↗
(Type, locals, serviceName)

Source from the content-addressed store, hash-verified

4170 }
4171
4172 function instantiate(Type, locals, serviceName) {
4173 // Check if Type is annotated and use just the given function at n-1 as parameter
4174 // e.g. someModule.factory('greeter', ['$window', function(renamed$window) {}]);
4175 // Object creation: http://jsperf.com/create-constructor/2
4176 var instance = Object.create((isArray(Type) ? Type[Type.length - 1] : Type).prototype);
4177 var returnedValue = invoke(Type, instance, locals, serviceName);
4178
4179 return isObject(returnedValue) || isFunction(returnedValue) ? returnedValue : instance;
4180 }
4181
4182 return {
4183 invoke: invoke,

Callers

nothing calls this directly

Calls 3

invokeFunction · 0.70
isObjectFunction · 0.70
isFunctionFunction · 0.70

Tested by

no test coverage detected