This is AngularJS I write.
<script type="text/javascript">
var app = angular.module("App1", []);
app.controller("ctrl1", function ($scope, $filter) {
$scope.GenderChoice = ["Male","Female"];
});
</script>
This code below is work. "Gender" changes value when i change radio button.
<input id="MaleOption" name="oo" type="radio" ng-model="Gender" value="{{GenderChoice[0]}}" />
<input id="FemaleOption" name="oo" type="radio" ng-model="Gender" value="{{GenderChoice[1]}}" />
I want to use ng-repeat with radio button. This code below is not work. When i click change radio button, "Gender" is not response. Actually, "Gender" never shows the value.
<input ng-repeat="x in GenderChoice" id="{{x}}Option" name="oo" type="radio" ng-model="Gender" value="{{x}}" />
This code below is not work too.
<input ng-repeat="x in GenderChoice" id="{{x}}Option" name="oo" type="radio" ng-model="Gender" value="{{GenderChoice[$index]}}" />
What wrong with these code. Thank for advance.