Closed umair-khanzada closed 8 years ago
Just set the model value to the default value you want. This should work.
but not have an attribute and also ng-checked="true" is not working for this. i work same like your trick.
Same issue, my ng-model value = 1, the check box is unchecked and the model value changes to 0
here is my checkbox `<checkbox ng-model="db.selectedGroup.is_primary" ng-true-value="1" ng-false-value="0"
`
and here is my object if the checkbox is not in the page
group_description: "", group_id: "db1-cfb5df1c-6027-11e4-b1b7-525400b87f6d", group_name: "Execs", is_primary: 1
then here is my object again when the checkbox is in the page
group_description: "", group_id: "db1-cfb5df1c-6027-11e4-b1b7-525400b87f6d", group_name: "Execs", is_primary: "0"
any suggestions?
At a first look you are mixing strings and integers, could this be the problem?
is_primary is 1 (int) at first and then "0" (string)
Please reopen if the problem still exists
how checkbox default check i tried checked attribute and also try ng-checked attribute but not work.