Skip to content

Commit 368e702

Browse files
authored
Merge pull request #1399 from NullVoxPopuli/patch-1
Update importing-inject-from-ember-service to have guidance for library authors that need to support ember prior to 4.1
2 parents 95e4ab7 + ede23fc commit 368e702

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)