【发布时间】:2020-07-24 18:17:19
【问题描述】:
我想在 Angular Material Stepper(https://material.angular.io/components/stepper/overview) 的每个步骤上加载一个新组件,并使用模板驱动的表单使用自己的路由。有人可以帮我解决这个问题吗?
例如: 我有这样的路由:
{
path: 'parent',
component: Parentcomponent1,
children: [
{
path: '',
redirectTo: 'child1',
pathMatch: 'full'
},
{
path: 'child1',
component: child1Component
},
{
path: 'child2',
component: child2Component
}
}
父组件1.html =>
<mat-horizontal-stepper>
<mat-step [routerLink]="child1"></mat-step>
<mat-step [routerLink]="child2"></mat-step>
<router-outlet></router-outlet>
</mat-horizontal-stepper>
它不工作。是否有任何替代方法或需要添加的东西才能使其工作?
【问题讨论】:
标签: angular typescript angular-material angular2-routing angular-components