lundi 20 avril 2020

TypeScript Creating all subclasses of abstract class

I have an abstract class and several classes that extends this class. I want to dynamically get all of the subclasses of that class, so I could create them all.

I tried the following: Typescript - Get all implementations of interface, which works fine, if all of the subclasses are at the same file as the abstract class.

Else, the file of the subclasses is never imported and thus it is never being registered.

Is there any other way to achieve this? Something like Reflection in C#?





Aucun commentaire:

Enregistrer un commentaire