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是的,我可以编码,但我不愿意。()在允许的字符列表中。谢谢