Answer the question
In order to leave comments, you need to log in
Why does is not a constructor appear?
Hello! Guys, I'm trying to write a simple game in TypeScript and ... I'm stuck at the very beginning.
There is something like this code (3 different files):
window.onload = () => {
var g: Tower.Weapon;
g = new Tower.MachineGun();
};
module Tower {
export class Weapon {
}
}
module Tower {
export class MachineGun extends Weapon {
}
}
Answer the question
In order to leave comments, you need to log in
Seems. figured it out myself. In the project settings, I checked the box to collect all TS files into one JS. At the same time, for some reason, the correct order of the scripts in the file is not always observed ... The MachineGun declaration appears before the Weapon. hence the error... Added to MachineGun.ts /// and it seems to work...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question