AngularJS provides ng-model to bind values to input fields. Binding radio buttons to scope variables is tricky.


Here you can find HTML markup of Gender radio buttons. 
<input type="radio" ng-model="gender" value="male" name="gender"/> Male
<input type="radio" ng-model="gender" value="female" name="gender"/> Female


This is script to access radio input variables in scope controllers

function myCtrl($scope) {
    $scope.gender = 'male';

1 comment:

  1. Thanks for sharing.I found a lot of interesting information here. A really good post, very thankful and hopeful that you will write many more posts like this one.



Follow this blog by Email

Popular Posts