export class ProfileComponent implements OnInit { id: string; constructor(private activatedRoute: ActivatedRoute) { \!h this.id = this.activatedRoute.snapshot.paramMap.get("id"); // Use id as required } }