我有一个非常简单的路由模块
const routes: Routes = [
{
path: '~user',
children :
[
{
path: 'manage',
component: UserManageComponent,
}
]
},
{
path: '**',
component: NavigationComponent,
}
];
它适用于/folder/subfolder/part/file.txt
等网址,但在第一个文件夹包含()
时失败,例如/folder (test)/subfolder/file.txt
我收到以下错误
Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'test'
根据我的理解,()是特殊的,它们用于命名出口路由。
我只想关闭此功能,以便path: **
匹配并加载NavigationComponent
只有REFRESH或应用程序的初始加载失败,[routerLink]='/folder (test)/subfolder'
之类的路由器链接才能正常工作。