<div class="list"> <label class="item item-radio" ng-repeat="k in kprs" ng-click="isDefaultKpr(k)"> <input type="radio" name="group" ng-model="k.IS_MR" value="1"> <div class="item-content"> {{k.NAME}}-{{k.IS_MR}} </div> <i class="radio-icon ion-checkmark"></i> </label> </div>
ng-model="k.IS_MR" 的值为1表示要选中当前的.
$scope.isDefaultKpr = function(k){ var params = [k._ID]; KprModel.setDefaultKpr(params).then(function(res){ KprModel.all().then(function(kprs){ $scope.kprs = kprs; }); }); };