In my application, I have used initializers to inject services to routes, controllers and components. I am trying to use ember engine now. I have shared my application services to my engine, but I need to inject the shared application services to the engine's routes, controllers and components using an initializer.
In my application, I can generate an initializer and inject the services. How to do that in my engine?
This command should create the initializer in the proper folder under the in-repo-engine:
Ideally, injecting a service into a controller/route/component is best done as stated in the other answer.
Refer: https://guides.emberjs.com/release/applications/dependency-injection/#toc_ad-hoc-injections