Checkbox not binding to scope in angularjs

前端 未结 4 943
旧时难觅i
旧时难觅i 2020-12-01 01:34

I am trying to bind a checkbox to scope using ng-model. The checkbox\'s initial state corresponds to the scope model just fine, but when I check/uncheck the checkbox, the m

4条回答
  •  一向
    一向 (楼主)
    2020-12-01 02:33

    I struggled with this problem for a while. What worked was to bind the input to an object instead of a primitive.

    
     Check Me!
    
    // Controller
    $scope.someObject.someProperty = false
    

提交回复
热议问题