Adding Parameter to Angular router.navigate

Following my comments you have to :

1 – Redefine your route

{path: 'call/:caller', component: MyComponent }

2 – Change your navigation in the parent component

this.router.navigate(["call", caller]);

3 – In the child component, get the param

import { ActivatedRoute } from '@angular/router';
// code until ...
myParam: string;
constructor(private route: ActivatedRoute) {}
// code until ...
ngOnInit() {
    this.route.params.subscribe((params: Params) => this.myParam = params['caller']);
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)