UNPKG

@studiohyperdrive/ngx-forms

Version:
12 lines (11 loc) 643 B
import { FormGroup } from '@angular/forms'; /** * FormGroup validator which checks if an array of controls in the control are filled in if the depended control is filled in * * @param controls - An array of controls. * @param dependedControlKey - A control within the group which the other controls depend on. * @param matchFunction - Optional function the dependedControl should check */ export declare const dependedRequiredValidator: <KeyType extends string = string>(controls: KeyType[], dependedControlKey: KeyType, matchFunction?: (data: any) => boolean) => (form: FormGroup) => { hasDependedRequiredError: string[]; } | null;