I already tried to follow the example of other answers from here and I did not succeed!
I created a reactive form (ie, dynamic) and I want to disable some fields at
Pay attention
If you are creating a form using a variable for condition and trying to change it later it will not work, i.e. the form will not change.
For example
this.isDisabled = true;
this.cardForm = this.fb.group({
'number': [{value: null, disabled: this.isDisabled},
});
and if you change the variable
this.isDisabled = false;
the form will not change. You should use
this.cardForm.get('number').disable();
BTW.
You should use patchValue method for changing value:
this.cardForm.patchValue({
'number': '1703'
});