Skip to content

TypeScript Constructors are erased unless explicitly called - parsing fails #32

@jonasandero

Description

@jonasandero

I have successfully used your framework to build a service but i am facing an issue. I have an entity class that I do not instanceiate any where in the code - it is only created by calls to TaJson.parse(). While can understand why tsc erases the constructor function - since it is not explicitly called - I wonder if there is a clever way to prevent it from being erased? The only ways i can come up with is to either create a dummy instance somewhere or to export a function that calls the constructor. Both feels a bit "hackish".

Ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions