Answers for "form control adding disabled and validators"

0

form control adding disabled and validators

value: string;
isDisabled: boolean;
//isDisabled and value come from your dynamic data.  
fb: FormBuilder;
myGroup: FormGroup;

this.myGroup = fb.group({
   form_control_name: new FormControl({
      value: this.value,
      disabled: this.isDisabled,
      Validators.required)}
   );
Posted by: Guest on August-14-2020

Code answers related to "TypeScript"

Browse Popular Code Answers by Language