The ng-true-value and ng-false-value directives prevent checkbox from being checked. #2220

Closed
markalanevans opened this Issue Mar 25, 2013 · 2 comments

Projects

None yet

3 participants

@markalanevans

If you set the ng-model and ng-true-value and / or ng-false-value
on checkbox, the checkbox will not be checked if the value for ng-model is true.

However, remove the ng-true-value and ng-false-value directives and it correctly checks the boxes.

Here is an example:
http://jsfiddle.net/friskd/wy4PM/1/

@pkozlowski-opensource

@markalanevans this works as expected. By using the ng-true-value directive you are defining what should be considered as "true" for a checkbox. At the beginning your model value is true which is not equal to "Yes", so this is why the second checkbox is unchecked. If you click on the second one then the model value is "Yes" and this is still different from true, so this is why the first checkbox is unchecked.

A fiddle showing model values should illustrate it better: http://jsfiddle.net/cHCdu/

Closing as it works as expected.

@iwyg
iwyg commented Nov 15, 2013

seems like in 1.2.0 it's totally broken if the input is required via ng-required http://jsfiddle.net/cHCdu/10/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment