-
Notifications
You must be signed in to change notification settings - Fork 27.5k
Length-based validation + "password" is correct input field type #601
Conversation
Here, take a look at this test. Shall it go? |
BTW, I don't know why you used ng:pattern as there's standard HTML5 attribute. |
we used ng:pattern because it behaves significantly different from pattern (pattern takes regexp without |
the password related commits landed as e82e64d |
Rebased my version on top of your work. |
btw I simplified the test slightly |
ng:minlength and ng:maxlength landed as a part of this push: [angular.js] IgorMinar pushed 3 new commits to master: http://git.io/XcIGEg I added some more docs, tests and e2e tests. |
Thanks for pointing out the issue with ng:pattern. I decided to use substr instead (fewer bytes) and added a test. the fix is now in the master branch: [angular.js] IgorMinar pushed 1 new commit to master: http://git.io/iDfGow |
Thanks for all work. This was very helpful. In the future, to make it easier for you to manage all changes, I suggest that you create a separate branch for the pull request. That way you don't need to clean up your master and remove all commits before syncing with our master branch. For more info please see: http://docs.angularjs.org/#!/misc/contribute Lastly, I'd like to send you an AngularJS T-shirt. Can you please fill out this form: http://goo.gl/D9uOx |
First I added missing validation method based on field length. I use "minlength" and "maxlength" 's attributes to set min and max value length, and set input.$error.MINLENGTH and input.$error.MAXLENGTH in case field's value is too short/long.
The second commit a fix: <input type="password" /> kept converted to <input type="text" /> by angular.js, which made it effectively useless for forms handling. I added "password" type to the list of correct HTML5 input types