ionic --> ion-checkbox问题
第一次取消以后不会变为false,要第二次取消才可以。哪位可以帮忙解答下。 附代码: html <ion-content padding=“true” style=“background-color: white;”>
<div class="list">
<ion-checkbox ng-repeat="item in devList" ng-model="item.checked" ng-checked="{{item.checked}}">
{{ item.name }}
</ion-checkbox>
<div class="item">
<pre ng-bind="devList | json"></pre>
</div>
</div>
</ion-content>
js
$scope.paramsAgainAll = function(){
for (var i=0;i<$scope.nextPerson.length;i++) {
var aa = {
'name':$scope.nextPerson[i].name,
'pickid':$scope.nextPerson[i].pickid,
'checked':'true'
}
$scope.devList.push(aa);
}
console.log($scope.devList);
};
1 回复
https://docs.angularjs.org/api/ng/directive/ngChecked
Note that this directive should not be used together with ngModel, as this can lead to unexpected behavior.