How to get id from the URL using snapshot or ActivatedRoute subscriber in Angular?
问题 I am getting value using snapshot method but it is getting the value after "classes" in this case 20 but I need 33 path like getting credits/33/classes/20 only 20 or credits/33/classes/ only null("") Update : I found a solution to my question. Now it is getting id properly. The mistake is accessing to element in the right child component, didn't work in child's MatDialog component within the Snapshot version. constructor(private route: ActivatedRoute) {} ngOnInit(): void { console.log