html部分:
<div>其他功能:</div>
<div ng-click="organizationAppCtrl.chooseItem(item)" ng-repeat="item in organizationAppCtrl.otherArr">
<img ng-show="!item.value" src="assets/images/select_box.png" />
<img ng-show="item.value" src="assets/images/select_true.png" />
<div ng-bind="item.name"></div>
</div>
js函数:
self.chooseItem = function(item){
if (item.value == true) {
item.value = false;
self.arr.splice(self.arr.indexOf(item),1);
console.log("--",self.arr)
}else{
item.value = true;
self.arr.push(item);
console.log("++",self.arr)
}
};