angular subscribe for route change code example
Example: route parammap subscribe angular 9
this.route.paramMap.subscribe((params: ParamMap) => console.log(params.get('id')));
this.route.paramMap.subscribe((params: ParamMap) => console.log(params.get('id')));