130
rated 0 times
[
133]
[
3]
/ answers: 1 / hits: 102129
/ 11 Years ago, mon, march 11, 2013, 12:00:00
I would like to be able to instantiate a typescript class where I get the class and constructor details at runtime.
The function I would like to write will take in the class name and constructor parameters.
export function createInstance(moduleName : string, className : string, instanceParameters : string[]) {
//return new [moduleName].[className]([instancePameters]); (THIS IS THE BIT I DON'T KNOW HOW TO DO)
}
More From » typescript