mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-2916] number range form validator added (#3279)
* number range form validator added * tests added
This commit is contained in:
@@ -62,7 +62,11 @@ export class SearchNumberRangeComponent implements SearchWidget, OnInit {
|
||||
this.form = new FormGroup({
|
||||
from: this.from,
|
||||
to: this.to
|
||||
});
|
||||
}, this.formValidator);
|
||||
}
|
||||
|
||||
formValidator(formGroup: FormGroup) {
|
||||
return parseInt(formGroup.get('from').value, 10) < parseInt(formGroup.get('to').value, 10) ? null : {'mismatch': true};
|
||||
}
|
||||
|
||||
apply(model: { from: string, to: string }, isValid: boolean) {
|
||||
|
Reference in New Issue
Block a user