I want a button to be disabled until a checkbox has been checked using a FormBuilder for Angular. I don\'t want to explicitly check the value of the checkbox and would prefe
Create a method to detect any changes
checkValue(event: any) {
this.formulario.patchValue({
checkboxControlName: event.target.checked
})
}
Put that method on an event change and ngModel required
properties
And use the convetional way to validate
this.formulario = new FormGroup({
checkboxControlName: new FormControl('', [Validators.required])
});
Source