I have a simple array of objects:
pickedFeeds = [
{
"id": "1",
"name": "ALLEN Production Lake",
"status": "IN_PROGRESS",
"owner": "ih546q"
},
{
"id": "2",
"name": "Demo Lake",
"status": "IN_PROGRESS",
"owner": "ih546q"
}
]
And then i have a list of "feeds" like this:
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'
}]
};
on the last list i have a checkboxes on them:
<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>
I want to do the following:
i want to check[V] the ones who are allready in the pickedfeeds array, when i uncheck i want to remove, if exist from the list of pickedFeeds and so forth.. How should i do so? what is my ng-model should be?