How to create a Class based on given String?
I tried this code but it doesn't work.
public create(className: string): ISports {
// className = "Baseball";
return new global[className]();
}
I keep getting this error.
Element implicitly has an 'any' type because type 'Global' has no index signature.