编辑:
现在我尝试这种方式
<input class="form-check-input deflog-check" type="checkbox" ngTrueValue = "1" ngFalseValue = "0" ng-value="chk_mail">
Ang像这样得到了vahlue innangular
object2Edit.notificacion = Number($scope.chk_mail) + Number($scope.chk_mail)
;
但$ scope.chk_mail是Nan
答案 0 :(得分:1)
更改
ng-value
到
ng-model
可以在https://stackoverflow.com/a/28718132/7104041
找到关于两者之间差异的良好解释编辑:
刚注意到其他事情。你应该改变这个
<input class="form-check-input deflog-check" type="checkbox" ngTrueValue = "1" ngFalseValue = "0" ng-value="chk_mail">
到
<input class="form-check-input deflog-check" type="checkbox" ng-true-value= "1" ng-false-value = "0" ng-model="chk_mail">
并在控制器中分配您的chk_mail
https://plnkr.co/edit/i9JdNnMAiK3O9No768Ei?p=preview
你可以看到它在这个吸管中是如何工作的