【发布时间】:2021-02-16 19:20:39
【问题描述】:
我看到了几个 Stack Overflow 问题,它们似乎在问类似的 [问题][1],但它们都不起作用,所以我想我会更明确地问。
我正在尝试传递多个必需的参数,以便我的 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
【问题讨论】:
标签: angular typescript routes