Typescript file order issue when extending classes

Viewed 1041

I am defining models using TypeScript and I have encountered an issue when extending classes. I have two classes, each within a code file of the same name:

class kanine {
     name = 'dog'
}

and

class beagle extends kanine {
    constructor(name: string) {
        super();
        this.name = name;
    }
}

Within the solution they appear as such:

enter image description here

When I run the application I get this error:

enter image description here

However, when I rename the code file which contains the kanine class from kanine.ts to 1kanine.ts, I do not get the error. Another workaround is by bundling them like this:

.Include("~/app/kanine.js")
.Include("~/app/beagle.js")

Instead of like this:

.IncludeDirectory("~/app", "*.js")

Is there a way to process the files in an explicit order without having to include them individually?

1 Answers
Related