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

Popular posts from this blog

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -

php - Prepared Statement Inner Join Cannot Pass Parameter by Reference -

c# - Value cannot be null or empty.\r\nParameter name: name -