Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 我如何在角路径中通过多个必需的路径?_Angular_Typescript_Routes - Fatal编程技术网

Angular 我如何在角路径中通过多个必需的路径?

Angular 我如何在角路径中通过多个必需的路径?,angular,typescript,routes,Angular,Typescript,Routes,我见过几个堆栈溢出问题,它们似乎在问类似的[问题][1],但没有一个有效,所以我想我应该问得更明确一些 我正在尝试传递多个必需的参数,以便我的URL返回 myURL/cohort-features/configuration-manager?template=myTemplate 在我的组件中,我正在通过 this.router.navigate(['/cohort-features', '/configuration-manager'], { queryParams: { template

我见过几个堆栈溢出问题,它们似乎在问类似的[问题][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作为一个字符串传递,
“/court features/configuration manager”/
,但仍然遇到同样的问题

我做错了什么?如何返回两个字符串?
[1] :

第二个路由器。导航路径不应以“/”开头:

this.router.navigate(['/features','configurationmanager']

更多有关:


p.S到绝对路径和相对路径的路由很复杂,sintax对我来说也有点混乱;-)

谢谢你的回答,但是删除反斜杠似乎没有什么区别。我认为这是一条绝对路径,否则你必须删除“/”在第一条路径中,也使用relativeTo-另一种可能性是,在路由模块中配置的路由导致导航重定向。同时检查路由配置和重定向,以防万一。另外,如果您直接在浏览器中键入管线,请确保其正常工作。这些都是路由问题的常见嫌疑犯,似乎不是这样。感谢您的尝试。我的配置有问题。在我的路由模块中。我不得不把它当作一根绳子传递。