I've just encountered an issue while trying to create an abstract component which is extended by a child component. The base class has some injected services (in the constructor). The consequence is that I also need to inject these services in the injector of all the child components.
On my search for a solution to avoid having to inject the services in the child components constructor, I found some old articles about using an Injector object/service. They all describe a simular solution.
- Angular 2 how to extend class which has dependency injections
- https://devblogs.microsoft.com/premier-developer/angular-how-to-simplify-components-with-typescript-inheritance/
- https://github.com/angular/angular/issues/5155
- How to extend a component with dependency injection?
I'm wondering if these solutions are still the best practice in Angular 9/10, or is there a better solution in newer angular versions?