Skip to content

Commit d60f9dd

Browse files
authored
Enhance README with details on DI limitations
Clarify limitations of Angular's class-based injection.
1 parent 67b8e37 commit d60f9dd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
<summary><strong>Angular Dependency Injection</strong></summary>
66

77
### Why use Inject instead of DI with the Constructor ?
8-
Ans. This is class-based injection — Angular automatically provides the service instance when the component (or directive, or service) is created.
9-
✅ Works great for components, directives, pipes, and services.
10-
❌ But only works inside class constructors.
8+
Ans. This is class-based injection — Angular automatically provides the service instance when the component (or directive, or service) is created.
9+
✅ Works great for components, directives, pipes, and services.
10+
❌ But only works inside class constructors.
1111
If you want to use a service in a function, effect, or utility file, you can’t — because there’s no class context.
1212

1313
</details>

0 commit comments

Comments
 (0)