docs: correct formatting in dependency injection guides

This commit is contained in:
SkyZeroZx
2025-11-05 20:16:00 -05:00
committed by Jessica Janiuk
parent e87f423d90
commit 61066071cf
2 changed files with 8 additions and 8 deletions
@@ -705,7 +705,7 @@ export class ModalComponent { }
- Must be provided wherever needed
- Always included in the same JavaScript bundle as the component or directive, even if the value is never injected
Note: If multiple directives on the same element provide the same token, one will win, but which one is undefined.
NOTE: If multiple directives on the same element provide the same token, one will win, but which one is undefined.
### Route providers
@@ -37,16 +37,16 @@ This requires access to a given injector, like the `EnvironmentInjector`, for ex
<docs-code header="src/app/heroes/hero.service.ts" language="typescript"
highlight="[9]">
@Injectable({
providedIn: 'root',
providedIn: 'root',
})
export class HeroService {
private environmentInjector = inject(EnvironmentInjector);
private environmentInjector = inject(EnvironmentInjector);
someMethod() {
runInInjectionContext(this.environmentInjector, () => {
inject(SomeService); // Do what you need with the injected service
});
}
someMethod() {
runInInjectionContext(this.environmentInjector, () => {
inject(SomeService); // Do what you need with the injected service
});
}
}
</docs-code>