Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to do a "greater than 0" validation with this library? #555

Closed
Cohaven opened this issue Feb 25, 2022 · 1 comment
Closed

How to do a "greater than 0" validation with this library? #555

Cohaven opened this issue Feb 25, 2022 · 1 comment

Comments

@Cohaven
Copy link

Cohaven commented Feb 25, 2022

Describe the problem statement?

How to do a "greater than 0" validation with this library? I tried RxwebValidators.minNumber({ value: 0 }), but it allows 0. And the greaterThanvalidator only accepts fields rather than static values. I can't use RxwebValidators.minNumber({ value: 1 }) because I want all of the decimal values between 0 and 1 to be valid.

The expected solution you would like

Add an option to the minNumber validator to make the comparison a minValue > formControl.value instead of minValue >= formControl.value. Even the documentation uses "greater than" terminology incorrectly to describe current behaviour.

Package version

@rxweb/reactive-form-validators: 2.1.6

@Cohaven
Copy link
Author

Cohaven commented Feb 25, 2022

I discovered that the following statement was false.

greaterThan validator only accepts fields rather than static values

@Cohaven Cohaven closed this as completed Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant