I'm trying to get a param in my route, but when i try to print it, is returning undefined in my console.
This is my routing module:
const routes: Routes = [
{
path: ':id',
component: ListaDadosPvSelecionadoComponent,
canActivate: [AuthGuard],
},
];
this is how i'm trying to get the params:
ngOnInit() {
this.activatedRoute.queryParams.subscribe((params) => console.log(params['id']));
}
when i go to route/3
my component is being rendered but i get:
undefined
Why?