This is a FormGroup that I have created:
myFormGroup = new FormGroup({
languageType: new FormControl("", Validators.required),
facilityId: new FormControl(""),
timeZone: new FormControl("", Validators.required),
name: new FormControl("", Validators.required),
address: new FormControl("", Validators.required),
branch: new FormControl(""),
}
I am attempting to update the 'branch' field as required within an if condition. This is what I have tried:
if(count > 0) {
this.myFormGroup = new FormGroup({
branch: new FormControl("", Validators.required)
});
}
However, this approach is not functioning as expected.