Here is a simple example of a form with radio inputs. Check out the DEMO on PLNKR:
<form class="some-inputs">
<div ng-repeat="da in data">
<span>{{$index}}: {{da}}</span>
<label>
<input type="radio" id="lock-{{$index}}"
name="lock-choice-{{$index}}"
ng-model="mdl['account-{{$index}}']['blocked']"
ng-value="da.blocked">
<span>blocked</span>
</label>
<label>
<input type="radio" id="unrealized-{{$index}}"
name="lock-choice-{{$index}}"
ng-model="mdl['account-{{$index}}']['unrealized']"
ng-value="da.unrealized">
<span>not blocked</span>
</label>
</div>
</form>
In this example, I'm using ng-model and ng-value instead of ng-checked. The objects with properties are printed for comparison purposes.
My question is why, in each example, the second radio button is always checked even if its value is false. The first radio, which has a truthy value, should be checked instead. Why does this happen?
When I remove the ng-value attributes from the input elements, none of the radios are checked, even though the ng-model properties already have values that could determine their checked state.