Skip to content

Commit 0b16d10

Browse files
committed
docs(ngValue): clarify the limitations of ngValue and option elements
1 parent e0198c1 commit 0b16d10

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/ng/directive/input.js

+9-4
Original file line numberDiff line numberDiff line change
@@ -2770,12 +2770,17 @@ var CONSTANT_VALUE_REGEXP = /^(true|false|\d+)$/;
27702770
* @name ngValue
27712771
*
27722772
* @description
2773-
* Binds the given expression to the value of `option` or `input[radio]`, so
2774-
* that when the element is selected, the `ngModel` of that element is set to
2773+
* Binds the given expression to the value of `<option>` or {@link input[radio] `input[radio]`},
2774+
* so that when the element is selected, the {@link ngModel `ngModel`} of that element is set to
27752775
* the bound value.
27762776
*
2777-
* `ngValue` is useful when dynamically generating lists of radio buttons using `ng-repeat`, as
2778-
* shown below.
2777+
* `ngValue` is useful when dynamically generating lists of radio buttons using
2778+
* {@link ngRepeat `ngRepeat`}, as shown below.
2779+
*
2780+
* Likewise, `ngValue` can be used to generate `<option>` elements for
2781+
* the {@link select `select`} element. In that case however, only strings are supported
2782+
* for the `value `attribute, so the resulting `ngModel` will always be a string.
2783+
* Support for `select` models with non-string values is available via `ngOptions`.
27792784
*
27802785
* @element input
27812786
* @param {string=} ngValue angular expression, whose value will be bound to the `value` attribute

0 commit comments

Comments
 (0)