I need to pass id as parameter to my angular component
In my html i have something like this
<a [routerLink]="['/viewjobdetail', currentJob.id]">
{{ currentJob.title }}
</a>
app.module.ts RouterModule.forRoot configured as
{ path: 'viewjobdetail/:id', component: JobDetailComponent }
in my calling component i have
import { ActivatedRoute } from '@angular/router';
constructor(private route: ActivatedRoute){}
ngOnInit(): void {
this.route.queryParams.subscribe(params => {
debugger;
var a = params['id'];
this.displayJobId = parseInt(params['id']);
});
But when i check it its always showing undefined for a, what i am doing wrong here? }