Angular ActiviatedRoute Property 'id' comes from an index signature, so it must be accessed with ['id'].
Solution
Use index instead of (.) operator.
ngOnInit(): void {
this.activatedRouter.params.subscribe((x) => {
alert(x['id']);
});
}
0 Comments
If you have any question please ask?