我正在尝试使用自定义值检查一个框.
Are you ready? <input type="checkBox" ng-model="checked" ng-init="checked=true" ng-true-value="sure" ng-false-value="nope"><br/> <tt> {{checked}}</tt><br/>
解决方法
NG-真值= “确定”.所以,ng-init =“checked =’sure’”
代码片段
<input type="checkBox" ng-model="checked" ng-init="checked='sure'" ng-true-value="sure" ng-false-value="nope">
Plunkr – http://plnkr.co/edit/ejYSsyIjMZSZua9cQyv1?p=preview