HTML checkbox.
<input type="checkbox" ng:model="..." [name="..."] [ng:true-value="..."] [ng:false-value="..."] [ng:change="..."]>
ng:model – {string} –
Assignable angular expression to data-bind to.
name(optional) – {string} –
Property name of the form under which the widgets is published.
ng:true-value(optional) – {string} –
The value to which the expression should be set when selected.
ng:false-value(optional) – {string} –
The value to which the expression should be set when not selected.
ng:change(optional) – {string} –
Angular expression to be executed when input changes due to user interaction with the input element.
<script> function Ctrl() { this.value1 = true; this.value2 = 'YES' } </script> <div ng:controller="Ctrl"> <form name="myForm"> Value1: <input type="checkbox" ng:model="value1"> <br/> Value2: <input type="checkbox" ng:model="value2" ng:true-value="YES" ng:false-value="NO"> <br/> </form> <tt>value1 = {{value1}}</tt><br/> <tt>value2 = {{value2}}</tt><br/> </div>
it('should change state', function() { expect(binding('value1')).toEqual('true'); expect(binding('value2')).toEqual('YES'); input('value1').check(); input('value2').check(); expect(binding('value1')).toEqual('false'); expect(binding('value2')).toEqual('NO'); });