HTML radio button.
<input type="radio" ng-model="{string}" value="{string}" [name="{string}"] [ng-change="{string}"]>
ngModel – {string} –
Assignable angular expression to data-bind to.
value – {string} –
The value to which the expression should be set when selected.
name(optional) – {string=} –
Property name of the form under which the control is published.
ngChange(optional) – {string=} –
Angular expression to be executed when input changes due to user interaction with the input element.
<script> function Ctrl($scope) { $scope.color = 'blue'; } </script> <form name="myForm" ng-controller="Ctrl"> <input type="radio" ng-model="color" value="red"> Red <br/> <input type="radio" ng-model="color" value="green"> Green <br/> <input type="radio" ng-model="color" value="blue"> Blue <br/> <tt>color = {{color}}</tt><br/> </form>
it('should change state', function() { expect(binding('color')).toEqual('blue'); input('color').select('red'); expect(binding('color')).toEqual('red'); });