How my structure looks like ?
namespace DataProviders
{
export function SomeExportFunction<T>(myConstructor: { new (): T; MappingOptions?: any; }): T[]
{
//getting "SomeClass" as a string from "someModuleOrNameSpace.SomeClass" which should be somewhere in "myConstructor"(parameter)
}
}
How to use ?
this.Something=SomeNamespace.SomeExportFunction(someModuleOrNameSpace.SomeClass);
I tried myConstructor.constructor.toString().match(/\w+/g)[1];
this will return Function
, bit I need SomeClass
.
Based on this post Get an object's class name at runtime in TypeScript.
So how can I get the class name of myConstructor
?