docs: update dependency-injection-context.md (#56736)

HeroService is not part of this example, and is only introduced in the next example. Use type Service1 for this.service1, as its type
PR Close #56736
This commit is contained in:
Ofer Segev 2024-06-27 15:18:58 +03:00 committed by Pawel Kozlowski
parent 0f4219cf0c
commit ae9505b702

View file

@ -23,7 +23,7 @@ class MyComponent {
private service2: Service2 = inject(Service2); // In context
constructor() {
this.service1 = inject(HeroService) // In context
this.service1 = inject(Service1) // In context
}
}
</docs-code>