0
我有對象的簡單數組:如何檢查複選框在陣列ID的媒體鏈接存在於角:
pickedFeeds = [
{
"id": "1",
"name": "ALLEN Production Lake",
"status": "IN_PROGRESS",
"owner": "ih546q"
},
{
"id": "2",
"name": "Demo Lake",
"status": "IN_PROGRESS",
"owner": "ih546q"
}
]
然後我有一個列表「飼料」是這樣的:
feeds:[{
id:1,
name:'ALLEN Production Lake'
},{
id:2,
name:'Demo Lake'
},
{
id:3,
name:'mamalake'
},
{
id:4,
name:'tatalake'
},
{
id:5,
name:'mapalake'
},
{
id:6,
name:'gagalake'
},
{
id:7,
name:'ramalake'
},
{
id:8,
name:'chakalake'
},
{
id:9,
name:'dumdumlake'
},
{
id:10,
name:'popolake'
}]
};
最後的名單上
我對他們有複選框:
<div ng-repeat='feed in feeds'>
<input type="checkbox" id='{{feed.id}}'/>
<label for='{{feeds.id}}' class='lake-name'>{{feed.name}}<span class='checkbox-input-style'></span></label>
我要做到以下幾點:
我想檢查[V]那些已準備好拾取數組中的數字, 當我取消選中要移除的數據時,如果存在pickFeeds列表中,等等。 我應該怎麼做?我的ng模型應該是什麼?
可能重複:http://stackoverflow.com/questions/20415704/angularjs-data-binding-checkboxes-to-object - 如果核對 – Christian 2014-12-05 13:10:43