I have a reactive form and based on the property fooRequired I want to set the field to be required or not.
I can't change that because it set at initial. so what can I do?
fooRequired = false;
form = new FormGroup({
foo: new FormControl(null, [Validators.required])
});
toggle() { this.fooRequired = !this.fooRequired; }