Closed egucciar closed 5 years ago
Hi, sorry that the docs are not clear in this regard. However, 1.2.x is a legacy release and doesn't receive any updates (except possivly security updates), and 1.4.x is obsolete and doesn't receive any updates at all.
In 1.6.6, you can find the information in https://code.angularjs.org/1.6.6/docs/api/ng/directive/ngMaxlength, although the "input" directives don't specifically list "maxlength".
We could theoretically add these attributes.
What do you suggest?
I see. I suppose I thought maybe a document that would have announced the introduction of the changed behavior to the framework would have been useful. It would have explained what was wrong with my code without me having to dig into angular source code to find out what I could be doing a bit different.
I realize 1.2 and 1.4 are very old. I'm a new developer to an Enterprise system that couldn't migrate from 1.2 as it needed to support certain IE versions till the end of this year. 1.4 is also what majority of "angular formly" uses in it's examples. Angular formly also claims to support 1.2, but so far in my experience, it's very buggy for 1.2 and I've had to fork it and fix a lot of errors and issues to proceed. Still, overall it's enhanced productivity for me, the major gaps between the capabilities of 1.2 and what's currently available in the docs is what I keep losing time on.
Anyway, today I need to continue forward and confirm a few more validation features and will let you know if I find similar gaps. Maybe if there was a legacy docs hosting it would be useful. Like if I could reference the docs for 1.2. then this would not even mention the hmtl5 validation and it would have been a stark contrast to current docs that do indicate this is how the framework is designed to work.
Or in one of the migration docs, specifying that ng-minlength can be replaced by minlength (non breaking change but new functionality should probably be mentioned either in release notes or upgrade docs at some point).
Not sure if I understand you correctly, but docs for 1.2.x definitely exist: https://code.angularjs.org/1.2.32/docs/api (although they don't help in your specific case). I am not 100% sure but it's possible that the behavior was intended to work from the beginning, but was then fixed by accident or something. Really hard to say since it's been so long.
It could be worth working through the CHANGELOG.md looking at each of the breaking changes between 1.2 and 1.4
Thanks for the comments, since I posted this I had moved on from validation for time being, but I have to return to it at some point in the near future. I will let you know if I find anything else.
Current behavior:
In 1.4, if I specify minlength="5", and do not enter 5 characters, validation error gets thrown. YAY! In 1.2, if I do the same, validation error not thrown. BOO. In 1.2, I can do ng-minlength="5", and then this works the same as 1.4 minlength="5". Great. I also realize, in 1.2, I CANNOT do ng-minlength="expression", but as per this issue, I can do that in 1.3+ https://github.com/angular/angular.js/issues/1405
The thing is, I spent at least a half hour searching the internet for documentation that would clearly spell this out, but couldn't find any that specifically said minlength="5" in 1.2 will not work. Actually all documentation seems to indicate that this should be working in any version. Maybe I'm crazy, not looking hard enough, or too "new" to angularJS to know the difference, but a way for me to clearly know what would be expected to work verses what would not in 1.2 would surely save me time debugging angular code.
Expected / new behavior:
I expect there to be a more clear outline on why the behavior for minlength="5" is different in 1.2 and 1.4