3

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.

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?

bits
  • 672
  • 2
  • 7
  • 26

0 Answers0