Down payment configuration for Loan Products (#1836)
Co-authored-by: Jose Alberto Hernandez <alberto@blue-daemon.local>
This commit is contained in:
co-authored by
Jose Alberto Hernandez
parent
a9b8543120
commit
861cf7a000
@@ -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;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user