AngularJS: ng-model not binding to ng-checked for checkboxes

后端 未结 6 832
别跟我提以往
别跟我提以往 2020-11-22 08:06

I referred to this before asking this question.

AngularJs doesn't bind ng-checked with ng-model

If ng-checked is evaluated to true

6条回答
  •  醉梦人生
    2020-11-22 08:28

    You can use ng-value-true to tell angular that your ng-model is a string.

    I could only get ng-true-value working if I added the extra quotes like so (as shown in the official Angular docs - https://docs.angularjs.org/api/ng/input/input%5Bcheckbox%5D)

    ng-true-value="'1'"
    

提交回复
热议问题