Closed rgaiacs closed 7 months ago
They do the name thing 🙃 Inject is 'the old thing'
The docs need updated (simply for consistency and less typing), service should be preferred, tho my RFC to deprecate inject is low priority atm.
Importing as service
is indeed preferred.
It was adjusted in the code examples (see https://github.com/ember-learn/guides-source/pull/1766). But it looks like this usage was over. A PR to change it would be appreciated!
Thanks for the clarification! https://github.com/ember-learn/guides-source/pull/1766 looks good to me. I will close this.
https://guides.emberjs.com/release/applications/dependency-injection/#toc_ad-hoc-injections says
but the example uses
import { service } from '@ember/service';
Can I have a clarification of
import { inject }
vsimport { service }
?