typedi
typedi copied to clipboard
fix: Using constructor injection from base class
Description
I have a base class that handles a lot of common logic that my sub classes use. The base class accepts a single dependency, and is only used by the base class. So having a constructor in the sub-class is redundant (and my xo
warns about it).
Minimal code-snippet showcasing the problem
abstract class AbstractThing {
private readonly myDependency: MyDependency;
constructor(myDependency: MyDependency) {
this.myDependency = myDependency;
}
}
@Service()
class RealThing extends AbstractThing {
}
Expected behavior
I expect MyDependency
to be injected properly, even without a constructor in the sub class.
Actual behavior
ContainerInstance
seems to be injected instead of MyDependency
.