传值:
this.router.navigate([
"/consultHome",
], {
queryParams: {
name: this.form.name,
}
});
接收:
constructor(public http: HttpClient, public router: Router, private activatedRoute: ActivatedRoute) {
activatedRoute.queryParams.subscribe((queryParams: any) => {
this.form.name = queryParams.name
console.log(this.form.name)
});
}