angular-ui-form-validation
angular-ui-form-validation copied to clipboard
Custom templates don't work properly
See the branch I made, https://github.com/csaftoiu/angular-ui-form-validation/tree/fix-custom-template . On the demo, I changed /views/errorTemplateOne.html
to:
<div>ab <small class="error" >a - {{errorMessage}} - b</small> bc</div>
However, when validation fails on a minlength error (with validation-min-length="{template:'/views/errorTemplateOne.html', value:6}"
), it just shows the error message, without any of the <div>
or <small>
that I added.
An update: If instead the template is:
<small class="error"></small>
Then I find the following behavior:
- If I type
fe
, then tab away, the error shows without thesmall
. - If I then click back, and type another character, the error shows with the
small
.
Something is wonky with the logic here.
Another update, the initial bug I found. If I have
validation-max-length="{template:'/views/errorTemplateOne.html', value:10}"
Using that same <small class="error"></small>
template, then on the 11th character it shows the proper error message, but if I type more characters it shows "Maximum of undefined characters", and the error message persists.
ok nice catch, working on this now