mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
9 lines
259 B
JavaScript
9 lines
259 B
JavaScript
export function getTypeOf(instance) {
|
|
return instance.constructor;
|
|
}
|
|
|
|
export function instantiateType(type: Function, params: Array = []) {
|
|
var instance = Object.create(type.prototype);
|
|
instance.constructor.apply(instance, params);
|
|
return instance;
|
|
}
|