【发布时间】:2019-05-09 11:19:23
【问题描述】:
正如标题所说,我想让最后一步在其余步骤都已填满时才可访问。
我的步骤如下所示:1-登录详细信息 -> 2-个人详细信息 -> 3-检查
不了解所有详细信息就去检查是没有意义的。但我不想线性进行,以便您可以随意在登录名和个人详细信息之间切换。
HTML:
<mat-horizontal-stepper #stepper>
<ng-template matStepperIcon="edit">
<mat-icon>check</mat-icon>
</ng-template>
<mat-step [stepControl]="registerForm" errorMessage="{{ 'REGISTRATION.STEPPER_ERROR_LOGIN' | translate }}">
...
</mat-step>
<mat-step [stepControl]="personalForm" errorMessage="{{ 'REGISTRATION.STEPPER_ERROR_PERSONAL' | translate }}">
...
</mat-step>
<mat-step [stepControl]="registerForm && personalForm" errorMessage="Überprüfung steht aus">
...
</mat-step>
</mat-horizontal-stepper>
TS:
@Component({
selector: 'app-registration',
templateUrl: './registration.component.html',
styleUrls: ['./registration.component.scss'],
providers: [{
provide: STEPPER_GLOBAL_OPTIONS, useValue: { showError: true }
}]
})
export class RegistrationComponent implements OnInit {
【问题讨论】:
标签: angular angular-material angular-material-stepper