Angular Material Input Required

添加出多行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;
    }
    
  }

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章