private static addFieldError(form: FormGroup, fieldName: string, errorName: string) {
form.controls[fieldName].setErrors({errorName: true});
form.controls[fieldName].markAsTouched();
}
Here setErrors is not as I would expect. This will set an error to the field with value:
{errorName: true}
I would like to use the errorName: string parameter of the function addFieldError as the key of the object I am adding to error collection, and not using key 'errorName' itelf.
How can achieve that?

setErrors({[errorName]: true})