javascript - How to do radio buttons in Angular -
this code. when submit switchcolors, server returns undefined it. how wrong?
also how should initiate $scope.swichcolors in controller? have $scope.switchcolors = '';
<label class="radio-inline"> <input type="radio" ng-model="$parent.switchcolors" value = "yes" >yes</input> </label> <label class="radio-inline"> <input type= "radio" ng-model = "$parent.switchcolors" value = "no" >no</input> </label>
try using ng-value instead of value
<label class="radio-inline"> <input type="radio" ng-model="$parent.switchcolors" ng-value = "yes" >yes</input> </label> <label class="radio-inline"> <input type= "radio" ng-model = "$parent.switchcolors" ng-value = "no" >no</input> </label>
Comments
Post a Comment