Reputation: 16440
<li ng-repeat="flagVm in flagVms track by $id(flagVm)">
<label for="alternative{{$index}}" ng-click="alternativeClicked()">
<input ng-model="$parent.alternative" value="{{ flagVm.id }}" type="radio" name="alternative{{$index}}" />
<span class="num-times-flagged">(Flagged {{ flagVm.count }} {{ flagVm.count > 1 ? 'times' : 'time' }}) </span>
Inference Id:
<span class="highlighted-id">{{ flagVm.duplicateId }}</span>
</label>
</li>
and
$scope.alternativeClicked = function (id)
{
//once iterating will probably be the actual flag obj
$scope.alternativeFound = 'yes';
};
Upvotes: 0
Views: 482
Reputation: 23244
I think using ng-click
with radio is a bad practice.
The better way is to use ng-change
or $watch
value change
Upvotes: 1