Skip to content

Commit b6340d1

Browse files
committed
docs(ngValue): improve use case description
1 parent e6afca0 commit b6340d1

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

src/ng/directive/input.js

+8-11
Original file line numberDiff line numberDiff line change
@@ -1960,22 +1960,19 @@ var CONSTANT_VALUE_REGEXP = /^(true|false|\d+)$/;
19601960
* @name ngValue
19611961
*
19621962
* @description
1963-
* Binds the given expression to the value of `<option>` or {@link input[radio] `input[radio]`},
1964-
* so that when the element is selected, the {@link ngModel `ngModel`} of that element is set to
1965-
* the bound value.
1963+
* Binds the given expression to the value of the element.
19661964
*
1967-
* `ngValue` is useful when dynamically generating lists of radio buttons using
1968-
* {@link ngRepeat `ngRepeat`}, as shown below.
1965+
* It is mainly used on {@link input[radio] `input[radio]`} and option elements,
1966+
* so that when the element is selected, the {@link ngModel `ngModel`} of that element (or its
1967+
* {@link select `select`} parent element) is set to the bound value. It is especially useful
1968+
* for dynamically generated lists using {@link ngRepeat `ngRepeat`}, as shown below.
19691969
*
1970-
* Likewise, `ngValue` can be used to set the value of `<option>` elements for
1971-
* the {@link select `select`} element.
1972-
*
1973-
* It can further be used to achieve one-way binding of a given expression to an input element that
1974-
* does not use ngModel.
1970+
* It can also be used to achieve one-way binding of a given expression to an input element
1971+
* such as an `input[text]` or a `textarea`, when that element does not use ngModel.
19751972
*
19761973
* @element input
19771974
* @param {string=} ngValue angular expression, whose value will be bound to the `value` attribute
1978-
* and `value` property of the element
1975+
* and `value` property of the element.
19791976
*
19801977
* @example
19811978
<example name="ngValue-directive" module="valueExample">

0 commit comments

Comments
 (0)