Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/30.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_Typescript_Command Line Interface - Fatal编程技术网

Angular 需要帮助,点击链接后子组件复制角度

Angular 需要帮助,点击链接后子组件复制角度,angular,typescript,command-line-interface,Angular,Typescript,Command Line Interface,使用子组件管线 const SignupRoutes: Routes = [ { path: 'firstStep', component: FirstStepComponent, pathMatch: 'full' }, { path: 'secondStep', component: SecondStepComponent, pathMatch: 'full' }, { path: 'thirdStep', component: ThirdStepComponent, pathM

使用子组件管线

const SignupRoutes: Routes = [
  { path: 'firstStep', component: FirstStepComponent, pathMatch: 'full' },
  { path: 'secondStep', component: SecondStepComponent, pathMatch: 'full' },
  { path: 'thirdStep', component: ThirdStepComponent, pathMatch: 'full' },
];

const appRoutes: Routes = [
  { path: '', component: LoginComponent },
  { path: 'login', component: LoginComponent },
  { path: 'index', component: IndexComponent },
  { path: 'service', component: ServicesComponent },
  { path: 'indoor', component: IndoorComponent },
  { path: 'invoice', component: InvoiceComponent },
  { path: 'report', component: ReportComponent },
  { path: 'settings', component: SettingsComponent },
  { path: 'shop', component: ShopComponent },
  { path: 'signup2', component: SignupComponent, children: SignupRoutes },
  { path: 'password', component: PasswordComponent },
  { path: 'settings/telephones', component: TelephonesComponent },
  { path: 'settings/password-edit', component: PasswordEditComponent },
  { path: '**', redirectTo: '/login'}
];
我的问题是重复的子组件,单击“下一步”按钮后,这些子组件不会相互替换。我得到了屏幕截图中的子组件列表 如何解决此问题?是否需要以某种方式清理旧的子组件?

更改

{ path: '', component: LoginComponent },


当路由有空路径但没有子路由时,您需要此选项。

问题仍然存在显示链接看起来像什么(它是如何创建的)?链接在哪里?下一步我的链接按钮创建在每个子组件之间移动them@GünterZöchbauer-感谢您提供的信息。它很有价值。
{ path: '', component: LoginComponent, pathMatch: 'full' },