CNode

ionic --> ion-checkbox问题

问答
Ssiwen945发布于10 年前最后回复10 年前1 回复6174 浏览0 收藏

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

第一次取消以后不会变为false,要第二次取消才可以。哪位可以帮忙解答下。 附代码: html

	<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)

F
flamingtop#1·10 年前

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.

参与回复
登录后即可参与回复。登录