ionic --> ion-checkbox问题
发布于 9 年前 作者 siwen945 5775 次浏览 来自 问答

15BC3D17-27C1-4A69-8048-EC67F593870B.png

第一次取消以后不会变为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.

回到顶部