Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

docs(input[number]): note issue with large number and step validation #16573

Merged
merged 1 commit into from
May 22, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion src/ng/directive/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,11 @@ var inputType = {
* error docs for more information and an example of how to convert your model if necessary.
* </div>
*
* ## Issues with HTML5 constraint validation
*
*
* @knownIssue
*
* ### HTML5 constraint validation and `allowInvalid`
*
* In browsers that follow the
* [HTML5 specification](https://html.spec.whatwg.org/multipage/forms.html#number-state-%28type=number%29),
Expand All @@ -679,6 +683,17 @@ var inputType = {
* which means the view / model values in `ngModel` and subsequently the scope value
* will also be an empty string.
*
* @knownIssue
*
* ### Large numbers and `step` validation
*
* The `step` validation will not work correctly for very large numbers (e.g. 9999999999) due to
* Javascript's arithmetic limitations. If you need to handle large numbers, purpose-built
* libraries (e.g. https://github.com/MikeMcl/big.js/), can be included into AngularJS by
* {@link guide/forms#modifying-built-in-validators overwriting the validators}
* for `number` and / or `step`, or by {@link guide/forms#custom-validation applying custom validators}
* to an `input[text]` element. The source for `input[number]` type can be used as a starting
* point for both implementations.
*
* @param {string} ngModel Assignable AngularJS expression to data-bind to.
* @param {string=} name Property name of the form under which the control is published.
Expand Down