Do Glimmer components receive injections from the ApplicationInstance?

I noticed that Glimmer components don’t receive service injections from the inject method on the ApplicationInstance like in instance initializers. For example, session will be undefined in a Glimmer component with the following in an instance initializer:

instance.inject('component', 'session', 'service:session')

Is this because @glimmer/component doesn’t extend from EmberObject?

Hi! Same question…

Now I have to inject services to each glimmer components via @service … ? weird…

I’m not sure exactly why, I assume @skaterdav85’s guess is probably about right. But implicit injection will be deprecated, so it’s probably worth moving away from it anyway.

2 Likes