1import { AbstractControl } from '@angular/forms';
2
3export const isControlRequired = (control: AbstractControl): boolean => {
4 if (!control) {
5 return false;
6 }
7
8 if (control.validator) {
9 const validator = control.validator({} as AbstractControl);
10 if (validator && validator.required) {
11 return true;
12 }
13 }
14
15 return false;
16};