sorry for the question title, can't figure out a better one.
So, i have this function that is triggered by a checkbox true/false value:
setReward(): void {
const rewardControl = this.myFormLost.get('reward');
if (this.lostRewardCheck === true) {
rewardControl.setValidators(Validators.required);
rewardControl.enabled // WHAT GOES HERE
this.renderer.invokeElementMethod(this.rewardAmountFocus.nativeElement, 'focus', []);
} else {
rewardControl.clearValidators();
this.myFormLost.patchValue({
reward: ''
});
}
rewardControl.updateValueAndValidity();
}
How i can enable the 'reward' input box? Default state is disabled, when the user marks check box as true, i don't know how to enable it.