Down payment configuration for Loan Products (#1836)

Co-authored-by: Jose Alberto Hernandez <alberto@blue-daemon.local>
This commit is contained in:
José Alberto Hernández
2023-08-07 16:41:50 -06:00
committed by GitHub
co-authored by Jose Alberto Hernandez
parent a9b8543120
commit 861cf7a000
11 changed files with 90 additions and 43 deletions
@@ -0,0 +1,11 @@
import { AbstractControl, ValidatorFn } from '@angular/forms';
export function rangeValidator(min: number, max: number): ValidatorFn {
return (control: AbstractControl): { [key: string]: boolean } | null => {
if (control.value !== undefined && (isNaN(control.value) || control.value < min || control.value > max)) {
return { 'range': true };
}
return null;
};
}