禁用命名出口路由

时间:2018-05-22 16:21:31

标签: angular angular-routing

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

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'之类的路由器链接才能正常工作。

0 个答案:

没有答案
相关问题