i have used Reactive forms in Angular8 for form binding. Here, initially the form is disabled, and when i click on edit button, the form is enabled, but here, the input should be enabled only if the checkbox is checked, or it should be disabled.
Ts:
edit() {
this.form.enable()
}
restrict() {
this.form = this.FB.group({
array: this.FB.array(
this.values.map(x => this.FB.group({
boolValue: this.FB.control(x.boolValue),
datetime: [
{ value:x.datetime, disabled: !x.boolValue }]
}))
)
});
this.form.valueChanges.subscribe(data => {
this.formEdit = true;
console.log('agentSettingsInfoForm', data,this.formEdit)
})
this.w9InfoDetails.valueChanges.subscribe(data => {
this.formEdit = true;
console.log('agentSettingsInfoFormdate', data,this.formEdit)
})
}