Reputation: 863
This is my code. When I submit switchColors, the server returns undefined for it. How is this wrong?
Also how should I initiate $scope.swichColors in my controller? Currently I 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>
Upvotes: 0
Views: 69
Reputation: 619
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>
Upvotes: 1