I have a scenario similar to this
<a [routerLink]=" ['../projects', project.id] ">
However, when attempting to retrieve a route parameter from the URL, I am not getting any results.
Here is my import:
import { Component} from '@angular/core';
import { ActivatedRoute } from '@angular/router';
This is my constructor:
constructor(private route: ActivatedRoute) {}
And here is how I handle it in ngOnInit:
ngOnInit() {
this.sub = this.route.params.subscribe(params => {
console.log(params); //only receiving an empty Object with `__proto__`
});
}
}
Can anyone offer me some assistance with this issue?