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' },