添加出多行Input, 解决点击一出, 多行显示校验问题
<div fxFlex="100" fxLayout="row" fxLayoutAlign="space-between center" fxFlex="1 0 auto" *ngFor="let _package of getControls(consignment, 'packages'); let x = index"> <div formGroupName="{{x}}" fxFlex="100" fxLayout="row" fxLayoutAlign="start center" class="pallet-inf"><input type="text" formControlName="length" [required]='radioValidate[x]'matInput appInputIntegerOnly> export class CreateComponent implements OnInit { radioValidate = []; } radioChange(event: MatRadioChange) { if (this.radioValue === '5'){ this.radioValidate[this.palletIndex] = true; }else{ this.radioValidate[this.palletIndex] = false; } }