I am new to Angular and trying to capture the selected radio value, but when using ng-repeat the documentation is fuzzy. Any help would be greatly 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>
Here is the controller, but I'm not sure about the correct choice of 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']);
source share