Skip to content
This repository has been archived by the owner on Nov 22, 2021. It is now read-only.

tag should be validated against both minLength and maxLength in tryAdd() #53

Closed
jrencz opened this issue Jan 8, 2014 · 3 comments
Closed

Comments

@jrencz
Copy link

jrencz commented Jan 8, 2014

now maxLength is implemented as attribute in template and min as condition in controller, which is inconsistent (both in code and in tests) and - in the case I run into it - adds complexity to project unit tests of modules which use this function.

It'll also make it easier to validate min and max (to define ng-invalid-* helper class)

@mbenford
Copy link
Owner

mbenford commented Jan 8, 2014

Hi Jarek.

maxLength has always been an attribute applied to the underlying input element. minLength, on the other hand, has to be implemented in Javascript because a "short" tag isn't supposed to be added, and I can't do that in HTML only.

What exactly do you find inconsistent?

@mgol
Copy link

mgol commented Jan 8, 2014

@mbenford You could apply the same logic to the minlength attribute as you do form maxlength. The native maxlength has a flaw that you can't even type anything beyond the limit and it's often useful to paste sth a little longer and remove some characters.

@mbenford
Copy link
Owner

mbenford commented Jan 8, 2014

Thanks, @mzgol. Now I get it and it makes sense. Will think more about it.

@mbenford mbenford modified the milestones: 2.0.0, post-1.1.1 Feb 18, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants