-
Notifications
You must be signed in to change notification settings - Fork 27.5k
ng-minlength="1" error in form validation form.FormController #8215
Comments
This is working as expected: if the input is empty and not required, it doesn't make sense to set an error before there's actually a value. Since the minlength is 1, you'll never see an error in this case |
Thank you for answer, this is now clear for me. |
It's possible that my comment didn't address the actual problem you describe. However, I am unable to reproduce the error: http://plnkr.co/edit/QBQz6k97msQ3lyZ21GLV?p=preview Okay, great that I could clarify things! |
Me issue is this: |
Okay, yes that's what my explanation was about: required and min / max length work independently from each other. I guess this is solved then. |
Anyway i think this is issue, becouse there isn't solution for this. |
solution for what exactly? what exactly is the problem you're having with this? |
Ok, i will explain it: This is exactly problem for all default states. How to determine dirty empty fields in angular form validation? |
Ah, I see what you mean. You want a property that reflects if there's input in the input. You can use |
Thank you, this is exactly me issue. But solved with .length. |
When ng-minlength="1" and NO required is used on form it seems is it there bug, becouse:
ng-minlength="1" produce with no chars (<1) true in $error.minlength
The text was updated successfully, but these errors were encountered: