mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
docs: fix Routed components example (#61278)
fixes #61277 PR Close #61278
This commit is contained in:
parent
fb65ad157c
commit
a0be4c19ff
1 changed files with 1 additions and 1 deletions
|
|
@ -576,7 +576,7 @@ It creates an `ActivatedRoute` object with the routing information and injects i
|
|||
|
||||
Here are the services injected into `HeroDetailComponent`:
|
||||
|
||||
<docs-code header="app/hero/hero-detail.component.ts (inject)" path="adev/src/content/examples/testing/src/app/hero/hero-detail.component.ts" visibleRegion="ctor"/>
|
||||
<docs-code header="app/hero/hero-detail.component.ts (inject)" path="adev/src/content/examples/testing/src/app/hero/hero-detail.component.ts" visibleRegion="inject"/>
|
||||
|
||||
The `HeroDetail` component needs the `id` parameter so it can fetch the corresponding hero using the `HeroDetailService`.
|
||||
The component has to get the `id` from the `ActivatedRoute.paramMap` property which is an `Observable`.
|
||||
|
|
|
|||
Loading…
Reference in a new issue