I assume that the constructor still needs to be handled by the subclass, like below. How about abstract
superclasses, also below?
export abstract class ClassA {
@bindable amount: number;
constructor(protected additionService: AdditionService) {
}
get doubleAmount(): number {
return this.additionService.add(this.amount, this.amount);
}
}
@inject(AdditionService, MultiplyService)
@customElement("triple-amount") // Is this valid for webpack, or does PLATFORM.moduleName('./triple-amount) need to be used?
export class ClassB extends ClassA {
// additionService not marked private or protected
constructor(additionService: AdditionService,
private multiplyService: MultiplyService) {
super(additionService);
}
get tripleAmount(): number {
return this.multiplyService.multiply(this.amount, 3);
}
}
The documentation is a little light, or just not clear enough.