I'm currently in the process of updating some older code and I have created a service that I want to inject into the constructor of a class. There are two key points to consider about this particular class. The first point is that it is instantiated by a factory, and the second is that it serves as a parent for another class.
class A extends AParent implements IA {
constructor(
protected someService: SomeService,
)
}
class B extends A {
constructor(
protected someService: SomeService,
)
super(someService);
}
The issue I am encountering is that the factory is unable to instantiate the A class because its constructor requires a parameter, which is the service.
What would be the most appropriate solution to resolve this problem?