You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 4, 2017. It is now read-only.
Test a routed component with parameters has a code snippet of subscribing to ActivatedRoute params and using the "id" parameter to get a hero from a getHero method.
ngOnInit(): void {
// get hero when `id` param changes
this.route.params.subscribe(p => this.getHero(p && p['id']));
}
The actual TOH code uses a switchMap, calls the HeroService, then subscribes to the returned hero.
Test a routed component with parameters has a code snippet of subscribing to
ActivatedRoute
params and using the "id" parameter to get a hero from agetHero
method.The actual TOH code uses a
switchMap
, calls theHeroService
, then subscribes to the returned hero.The aside below this code snippet refers to a
forEach
, apluck
, and acatch
, none of which are used in the example or actual code.All of this is confusing. The aside should probably be removed and the code snippet updated to match the latest TOH code.
The text was updated successfully, but these errors were encountered: