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

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

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