I'm trying to set conditional form validations on an angular reactive form and need some help.
I have a form control where the user sets their entity type to either Individual or Business
<select formControlName="entity">
<option [value]="individual">Individual</option>
<option [value]="business">Business</option>
</select>
I then have form inputs that display or hide based upon what entity is selected:
<div *ngIf="myForm.controls.entity.value == individual>
<input formControlName="fullName" />
</div>
<div *ngIf="myForm.controls.entity.value == business>
<input formControlName="businessName" />
</div>
How can I make both inputs required only if the corresponding entity is selected?