angular-cn/packages/forms/test
Sonu Kapoor 88a235de3a fix(forms): handle numeric values properly in the validator (#36157)
Previously, the behavior of the `minLength` and `maxLength` validators
caused confusion, as they appeared to work with numeric values but
did not in fact produce consistent results. This commit fixes the issue
by skipping validation altogether when a numeric value is used.

BREAKING CHANGES:

* The `minLength` and `maxLength` validators now verify that a value has
numeric `length` property and invoke validation only if that's the case.
Previously, falsey values without the length property (such as `0` or
`false` values) were triggering validation errors. If your code relies on
the old behavior, you can include other validators such as [min][1] or
[requiredTrue][2] to the list of validators for a particular field.

[1]: https://angular.io/api/forms/Validators#min
[2]: https://angular.io/api/forms/Validators#requiredTrue

Closes #35591

PR Close #36157
2020-05-05 11:50:00 -07:00
..
BUILD.bazel test: disable failing saucelabs tests (#36620) 2020-04-14 10:13:33 -07:00
directives_spec.ts style(forms): reformat of the `forms` package after clang update (#36466) 2020-04-07 09:47:09 -07:00
form_array_spec.ts style(forms): reformat of the `forms` package after clang update (#36466) 2020-04-07 09:47:09 -07:00
form_builder_spec.ts style(forms): reformat of the `forms` package after clang update (#36466) 2020-04-07 09:47:09 -07:00
form_control_spec.ts style(forms): reformat of the `forms` package after clang update (#36466) 2020-04-07 09:47:09 -07:00
form_group_spec.ts style(forms): reformat of the `forms` package after clang update (#36466) 2020-04-07 09:47:09 -07:00
reactive_integration_spec.ts style(forms): reformat of the `forms` package after clang update (#36466) 2020-04-07 09:47:09 -07:00
spies.ts style(forms): reformat of the `forms` package after clang update (#36466) 2020-04-07 09:47:09 -07:00
template_integration_spec.ts style(forms): reformat of the `forms` package after clang update (#36466) 2020-04-07 09:47:09 -07:00
validators_spec.ts fix(forms): handle numeric values properly in the validator (#36157) 2020-05-05 11:50:00 -07:00
value_accessor_integration_spec.ts style(forms): reformat of the `forms` package after clang update (#36466) 2020-04-07 09:47:09 -07:00