我有一个输入字段,我希望它隐藏,它应该只在下拉菜单中的选择是“飞机类型”时才可见:这是 html 代码:
<mat-form-field appearance="outline" class="width-1 col-4">
<mat-label>Type</mat-label>
<mat-select formControlName="typeId">
<mat-option *ngFor="let type of typeList" [value]="type.id">
{{ type.name }}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field appearance="outline" class="width-1 col-4">
<mat-label>Type of Motor</mat-label>
<input
matInput
placeholder="Type of Motor"
formControlName="typeMotor"
name="typeMotor"
id="typeMotor"
/>
</mat-form-field>
第一个 mat-form-field 是下拉菜单,第二个 mat-form-field 是我希望在某些条件下隐藏或可见的字段。