docs: Updated router guide content and examples for paramMap
and queryParamMap, tracing, and incidental improvements. closes #16991 and #16259 which it also fixes.
This commit is contained in:

committed by
Matias Niemelä

parent
4268c82898
commit
8d01db4638
@ -14,6 +14,6 @@ export class CrisisDetailComponent implements OnInit {
|
||||
constructor(private route: ActivatedRoute) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.id = parseInt(this.route.snapshot.params['id'], 10);
|
||||
this.id = parseInt(this.route.snapshot.paramMap.get('id'), 10);
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ export class HeroDetailComponent implements OnInit {
|
||||
private heroService: HeroService) { }
|
||||
|
||||
ngOnInit() {
|
||||
let id = parseInt(this.route.snapshot.params['id'], 10);
|
||||
let id = parseInt(this.route.snapshot.paramMap.get('id'), 10);
|
||||
this.heroService.getHero(id).then(hero => this.hero = hero);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user