【发布时间】:2015-05-20 23:00:11
【问题描述】:
我的复选框的默认值为“true”,我在其他地方以相同的形式使用复选框的$viewValue。在应用程序开始时,即使选中了复选框,复选框的 $viewValue 也会显示“false”,但仅在用户关闭/打开复选框之前。 What's going on here?
html
<body ng-app="myApp">
<form name="testForm">
<label>The Checkbox
<input type="checkbox" name="testCheck" data-ng-model="testCheck" data-ng-checked="true"></input>
</label>
</form>
<p>{{ testForm.testCheck.$viewValue }}</p>
</body>
javascript
angular.module('myApp', []);
【问题讨论】:
标签: javascript html angularjs