it is necessary to select different checkbox values and pass values to the background, but why manipulate the true and false coming from the background?
<div ng-repeat="item in ctrl.nndata">
<input type="checkbox" ng-click="ctrl.chck(item)">
</div>
background fake data
this.nndata=[{
paratetime: "page",
name: "12345",
displayname: "",
isdranted: false,
},{
paratetime: "page",
name: "12345",
displayname: "",
isdranted: false,
}]
}
chck(data){
let kong=this.kong=[];
let datasss=this.nndata;
if(data.isdranted){
kong.map(function(ite,index){
if(ite==data.name){
kong.splice(index,1)
datasss.map(function(dd,ix){
if(dd.name==data.name){
console.log(dd.name)
datasss[ix]["isdranted"]=false
console.log(datasss[ix]["isdranted"])
}
})
}
})
}else{
kong.push(data.name)
datasss.map(function(dd,ix){
if(dd.name==data.name){
console.log(dd.name)
datasss[ix]["isdranted"]=true
console.log(datasss[ix]["isdranted"])
}
})
this.nndata=datasss
console.log(datasss)
}
console.log(kong)
this.kong=kong;
}