2016-06-23 12:47:54 -04:00
|
|
|
/**
|
|
|
|
* @license
|
|
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
*/
|
|
|
|
|
2016-06-08 18:45:15 -04:00
|
|
|
export function getTypeOf(instance: any /** TODO #9100 */) {
|
2015-03-30 10:37:33 -04:00
|
|
|
return instance.constructor;
|
|
|
|
}
|
|
|
|
|
2015-08-28 14:29:19 -04:00
|
|
|
export function instantiateType(type: Function, params: any[] = []) {
|
2016-09-12 23:30:42 -04:00
|
|
|
return new (<any>type)(...params);
|
2015-03-30 10:37:33 -04:00
|
|
|
}
|