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

Custom templates don't work properly #71

Open
csaftoiu opened this issue Nov 6, 2015 · 3 comments
Open

Custom templates don't work properly #71

csaftoiu opened this issue Nov 6, 2015 · 3 comments

Comments

@csaftoiu
Copy link

csaftoiu commented Nov 6, 2015

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.

@csaftoiu
Copy link
Author

csaftoiu commented Nov 6, 2015

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 the small.
  • If I then click back, and type another character, the error shows with the small.

Something is wonky with the logic here.

@csaftoiu
Copy link
Author

csaftoiu commented Nov 6, 2015

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.

@nelsonomuto
Copy link
Owner

ok nice catch, working on this now

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

2 participants