View source Improve this doc

ngValue
directive in module ng

Description

Binds the given expression to the value of input[select] or input[radio], so that when the element is selected, the ngModel of that element is set to the bound value.

ngValue is useful when dynamically generating lists of radio buttons using ng-repeat, as shown below.

Usage

as attribute
<input ng-value="{string}">
   ...
</input>

Parameters

ParamTypeDetails
ngValue
(optional)
string

angular expression, whose value will be bound to the value attribute of the input element

Example

Source







Demo