How to Set Custom Validation Angular as i am getting undefined of controls
FormControl.setValidators(this.validateCall);
validateCall(): ValidatorFn {
return (control: FormControl): ValidationErrors | null => { // not getting control value here
const val = control.value;
if(val == null || val == undefined) {
return {
atLeastOneRequired: {
valid: false
}
}
}
return null;
}
indexbtw?