You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
I am using a checkbox bind to json object where the value is numeric 1 or 0. Angularjs doesn't seem to work properly if the value of the model is numeric.
See this plunkr below and note that "value2" model obj given numeric value 1 and having the checkbox field with ng-true-value='1' doesn't make the checkbox checked.
Hi,
I am using a checkbox bind to json object where the value is numeric 1 or 0. Angularjs doesn't seem to work properly if the value of the model is numeric.
See this plunkr below and note that "value2" model obj given numeric value 1 and having the checkbox field with ng-true-value='1' doesn't make the checkbox checked.
With observation, I have noticed angular ng-true-value is actually doing '1' === 1 to model numeric value and returns false, this can work if it compares with == only. This is define in the line here I think: https://github.com/angular/angular.js/blob/master/src/ng/directive/input.js#L646
Plunkr: http://plnkr.co/edit/cBBj54NKQ0OZXSZCQkdd?p=preview
The text was updated successfully, but these errors were encountered: