Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.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_Angular Routing - Fatal编程技术网

Angular 禁用命名出口路由

Angular 禁用命名出口路由,angular,angular-routing,Angular,Angular Routing,我有一个非常简单的路由模块 const routes: Routes = [ { path: '~user', children : [ { path: 'manage', component: UserManageComponent, } ] }, { path: '**', component: NavigationComponent, } ];

我有一个非常简单的路由模块

const routes: Routes = [
  {
    path: '~user',
    children  :
    [
        {
            path: 'manage',
            component: UserManageComponent,
        }
    ]
  },
  {
    path: '**',
    component: NavigationComponent,
  }
];
它适用于URL,如
/folder/subfolder/part/file.txt
,但当第一个文件夹包含
()
例如
/folder(test)/subfolder/file.txt

我得到以下错误

错误:未捕获(承诺中):错误:无法匹配任何路由。URL段:“测试”

据我所知,()是特殊的,它们用于命名出口路由

我只想关闭此功能,以便
path:*
将匹配并加载
NavigationComponent


它只会在刷新或初始加载应用程序时失败,路由器链接(如
[routerLink]='/folder(test)/subfolder'
工作正常。

也许可以对url进行编码<代码>%2文件夹%20%28测试%29%2子文件夹%2文件.txt是的,我可以编码,但我不愿意。()在允许的字符列表中。谢谢