forked from angular/angular.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(input): validate minlength/maxlength for non-string values
Use viewValue for minlength/maxlength validation if model value is not a string. This allows ngMinlength and ngMaxlength to be used for number inputs. Closes angular#7967 Closes angular#8811
- Loading branch information
Showing
2 changed files
with
101 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I think it's better to only use viewValue here and never model value. We do the same thing for the required validator.