Repository navigation
Conversation
…th and ngMaxlength Fixes angular#7848
|
Fix for v1.2.x branch - #7858 |
|
I think there's something else going on. For example, if you change the model value to string, it's still not working initially. If you manipulate the model value so it's set after a short timeout, the validation works. Same when typing in the input. I think this is related to the validation being broken in some cases when the form is first compiled, see a8c7cb8 |
|
@Narretz , here is example with fixed ngMaxlength directive
I couldn't make that in the plunker. Maybe there are some issues with validators, but i just fixed little bug with ngMaxlength and ngMinlength. This directives expected only strings previously, and couldn't get |
|
@matsko, need you here |
|
I personally think using the viewValue as in #7968 is more consistent over the board, because some input types will not have a length property on the model. |
|
@Narretz , I agree, using the viewValue seems the right way. |
|
This should be fixed in master for all supported input types. |
There is an issue - if ng-model value set to a nonstring (via js), the ngMinlength and ngMaxlength don't work properly.
Issue example http://plnkr.co/edit/y65LU7xJFSi4L9Ui4WqZ?p=preview
Fixes #7848