I am new to Angular and facing difficulties in capturing the selected radio value when using ng-repeat. The documentation is a bit unclear on this matter. Any assistance or guidance would be highly appreciated.
<div ng-repeat="item in ed">
<label for="{{item['code']}}">
<input ng-change="getPlanTypes()" ng-model="ed" type="radio" id="{{item['code']}}" name="effective_date" value="{{item['code']}}">
{{item['date']}} </label>
</div>
Although here is the controller, I am unsure of the correct approach to retrieve the selected radio value:
rates.controller('getEffectiveDates',
function($scope, $http, $location, myService, localStorageService) {
myService.effective_dates().then(function(ed) {
$scope.ed = ed;
});
$scope.getPlanTypes = function() {
console.log($scope.ed['code']); //This attempt is returning undefined
localStorageService.add('code',$scope.ed['code']);
$location.path("/plan-types");
}
});