If I use a input type=number with min or max restrictions, then AngularJS, just sets a boolean field <form>.<field>.$error.min = true
That means to show the actual min/max values I have to have them twice in the code, like this:
http://plnkr.co/edit/KfFwfaVncAIvKFwVOEHP?p=previewNotice how there are two occurrences of "3" (min) and "10" (max) (one in the min/max attribute and one in the actual error text).
That prevents me from writing a directive that shows all validation errors and at the same time shows the actual min/max values to the user.
How about ng setting not just a boolean, but an object with the "validation parameter", like <form>.<field>.$error.min = { min: 3} ?
This would still work with code that just checks for a truthy value.
For even more code compatibility (if somebody really did something like "ng-show='form.field.error.min === true' ", ng could also
set both "<form>.<field>.$error.min = true" and "<form>.<field>.$error.minValue = 3"
What do you think? Is there already a better way?
Is a patch for either variant welcome?