我已经看到了几个Stack Overflow问题,它们似乎提出了类似的问题,但它们都不起作用,所以我想我应该问得更明确一些。
我正在尝试传递多个必需的参数,以便我的URL返回
myURL/cohort-features/configuration-manager?template=myTemplate在我的组件中,我传递
this.router.navigate(['/cohort-features', '/configuration-manager'], { queryParams: { template: template.key } })问题是Angular忽略了第一组括号,只是返回
myURL/configuration-manager?template=myTemplate不清楚为什么它忽略了第一组括号。我也尝试过将url作为一个字符串'/cohort-features/configuration-manager'/进行传递,但仍然遇到同样的问题。
我做错了什么?如何同时返回两个字符串? 1:passing multiple params in route angular 4
发布于 2021-02-17 03:36:38
第二个router.navigate路径不能以“/”开头:
this.router.navigate('/cohort-features','configuration-manager',
更多信息请访问:https://www.tektutorialshub.com/angular/angular-navigating-between-routes/
P.S路由到绝对路径和相对路径很棘手,sintax对我也有点困惑;-)
https://stackoverflow.com/questions/66230830
复制相似问题