Skip to content

Commit c698f89

Browse files
Update importing-inject-from-ember-service.md
1 parent 1d33ca7 commit c698f89

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

content/ember/v6/importing-inject-from-ember-service.md

+7
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,10 @@ export default class MyRoute extends Route {
1919
```
2020

2121
You can use the [ember-codemod-remove-inject-as-service](https://github.com/ijlee2/ember-codemod-remove-inject-as-service) codemod, to fix all violations.
22+
23+
If you're working on a library that needs to support ember-source prior to 4.1, you can support both styles of `service` via:
24+
```js
25+
import * as emberService from '@ember/service';
26+
27+
const service = emberService.service ?? emberService.inject;
28+
```

0 commit comments

Comments
 (0)