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

Commit dc04678

Browse files
committed
docs(input[radio]): clarify difference between value and ngValue
Closes #7971
1 parent 528d7f9 commit dc04678

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/ng/directive/input.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -913,12 +913,15 @@ var inputType = {
913913
* HTML radio button.
914914
*
915915
* @param {string} ngModel Assignable angular expression to data-bind to.
916-
* @param {string} value The value to which the expression should be set when selected.
916+
* @param {string} value The value to which the `ngModel` expression should be set when selected.
917+
* Note that `value` only supports `string` values, i.e. the scope model needs to be a string,
918+
* too. Use `ngValue` if you need complex models (`number`, `object`, ...).
917919
* @param {string=} name Property name of the form under which the control is published.
918920
* @param {string=} ngChange Angular expression to be executed when input changes due to user
919921
* interaction with the input element.
920-
* @param {string} ngValue Angular expression which sets the value to which the expression should
921-
* be set when selected.
922+
* @param {string} ngValue Angular expression to which `ngModel` will be be set when the radio
923+
* is selected. Should be used instead of the `value` attribute if you need
924+
* a non-string `ngModel` (`boolean`, `array`, ...).
922925
*
923926
* @example
924927
<example name="radio-input-directive" module="radioExample">

0 commit comments

Comments
 (0)