Closed jones1008 closed 3 years ago
Turns out you have to add a default value to the parameter of the constructor as described here to get rid of this error.
So I changed my class Team
into this:
export default class Team extends Entity {
@field({name: 'name'})
name: string
constructor(name: string = '') {
super();
this.name = name;
}
}
I don't know why this is needed but it works...
Seems to be an issue with TypeScript and not firebase-firestorm.
I have a TypeScript class
Game
with a subCollection classTeam
.As soon as I add a constructor to the
Team
class I get the following TypeScript error:I don't have this error if I don't have a constructor within the
Team
class.Is it not possible to use a constructor within a subCollection class?