I m new to angular 4 and trying to test one of the angular 4 feature router.paramMap from unit tests, Reading route params in fallowing way and working as expected in my applica
Your code has a problem, in order to get a param from the URL, you have to write things in a different way.
constructor(private router:Router, private actRoute:ActivatedRoute) {
}
ngOnInit() {
this.router.paramMap
.switchMap((params: ParamMap) => {
params.get(id);
....
})
.subscribe((....) => {
....
})
}