在 Angular 11 项目中,我有一个Angular Material Stepper控件。我的第一步包含一个很像这样的表格:
<mat-horizontal-stepper [linear]="true" #stepper>
<mat-step [stepControl]="step.formGroup">
<form [formGroup]="formGroup">
<label for="code">Enter code</label>
<input name="code" formControlName="code" required />
<button matStepperNext>Continue</button>
</form>
</mat-step>
<mat-step>
<!-- step 2 -->
</mat-step>
</mat-horizontal-stepper>
我想显示当表单有错误时被<button>
装饰matStepperNext
为禁用,当它不使用 CSS 类时被启用。我怎样才能完成这项工作?