The reason for this does not work, you use ng-repeat , and you define the ng-model variable in it. The ng-repeat method works, it creates a new child region (prototypically inherited) at each iteration of the collection. Thus, the ng-model , which is in the ng-repeat pattern, belongs to the newly created area. Here ng-model="selectedOccurrence" create the scope selectedOccurrence variable on each ng-repeat iteration.
To overcome this problem, you need to follow the dot rule when defining a model in AngularJS
Markup
<body ng-controller="testController"> <form> <div ng-repeat="option in occurrenceOptions track by $index"> <input type="radio" name="occurrences" ng-value="option" ng-model="model.selectedOccurrence" /> <label>{{ option }}</label> </div> </form> <div>The selected value is : {{ model.selectedOccurrence }}</div> </body>
code
$scope.model = {}; //defined a model object $scope.model.selectedOccurrence = 'current'; //and defined property in it
Demo plunkr
OR Another preferred way would be to use the controllerAs template when declaring the controller (use this instead of the $scope internal controller).
HTML
<body ng-controller="testController as vm"> <form> <div ng-repeat="option in vm.occurrenceOptions"> <input type="radio" name="occurrence" ng-value="option" ng-model="vm.selectedOccurrence" /><label>{{ option }}</label> </div> </form> </body>
Controller as a demonstration
source share