Email: new FormControl('', [Validators.required, Validators.email])
function validateInSequence(
...validators: ( (formControl: FormControl) => any )[]
): (formControl: FormControl) => any {
return function (formControl: FormControl): any {
for (let i = 0; i < validators.length; i++) {
const validationResult = validators[i](formControl);
if (validationResult !== null) {
return validationResult;
}
}
return null;
};
}
new FormControl('', [validateInSequence(Validators.required, Validators.email)]);