It looks like you're using the disabled attribute with a reactive form directive. If you set disabled to true when you set up this control in your component class, the disabled attribute will actually be set in the DOM for you. code example

Example 1: how to set disabled flag formgroup angular

this.form.controls['name'].disable();

// or

<input formControlName="id" placeholder="ID" [attr.disabled]="true"></input>

Example 2: 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)}
   );

Tags:

Html Example