Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.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_Angular6_Angular Routing - Fatal编程技术网

Angular 带有子级的路径中的默认路径

Angular 带有子级的路径中的默认路径,angular,angular6,angular-routing,Angular,Angular6,Angular Routing,我使用angular 6,对于应用程序的cms,我在app.modules.ts文件中设置了以下路径 { path: 'cms', component: CmsComponentComponent, children: [ { path: 'register', component: RegisterComponent }, { path: 'login', component: LoginComponent }, { path: 'profile', component: Prof

我使用angular 6,对于应用程序的cms,我在
app.modules.ts
文件中设置了以下路径

{ path: 'cms', component: CmsComponentComponent, children: [
  { path: 'register', component: RegisterComponent },
  { path: 'login', component: LoginComponent },
  { path: 'profile', component: ProfileComponent, canActivate:[AuthGuard] },
  { path: 'educate', component: EducateComponent, canActivate:[AuthGuard] }
]},
我想要一个默认的
cms
,所以如果我键入
app/cms
,我就要注册了

我该怎么做


谢谢

据我所知,您只需添加如下重定向路由:

{ path: 'cms', component: CmsComponentComponent, children: [
  { path: 'register', component: RegisterComponent },
    ...
  { path: '', redirectTo: '/register', pathMatch: 'full' }
]},