disabled input activeforms code example
Example 1: disable control with formbuilder
this.userProfileForm = this.formBuilder.group({
// ...
password: [{
value: null,
disabled: !this.isResetPassword
}],
newPassword: [{
value: null,
disabled: !this.isResetPassword
}],
reTypePassword: [{
value: null,
disabled: !this.isResetPassword
}]
});
Example 2: can we get the value of form control after disabling it angular
this.myForm.getRawValue()