I have a routerlink that looks like this:
<li class="list-group-item d-flex justify-content-between align-content-center" *ngFor = "let union of activeUnions" [routerLink] = "['union',union.id]">
Which is routing using the route:
const routes: Routes = [
{
path: '',
component: IndexPage
},
{
path:"new",
component:NewPage
},
{
path:"union/:id",
component:UnionPage
}
];
This is sending me to the required component but when i try to get the id like such
ngOnInit() {
let id = this.$common.$route.snapshot.paramMap
console.log(id);
}
I am getting an empty object instead of an object containing the id from the url, whats is wrong?