I have two arrays coming from web service of object. One is all categories and other one is selected categories like this
$scope.categories = [
{ "id": 1, "name": "cat1" },
{ "id": 2, "name": "cat2" },
{ "id": 3, "name": "cat3" },
{ "id": 4, "name": "cat4" }
];
$scope.selected_category = [
{ "id": 1, "name": "cat1" },
{ "id": 2, "name": "cat2" }
];
and my markup is like this
<div class="form-group">
<label>Category</label>
<div class="clr"></div>
<label class="checkbox-inline" ng-repeat="item in categories">
<input type="checkbox" value="{{item.id}}" ng-model="?" ng-checked="?">
{{item.name}}
</label>
</div>
I can't figure out how do I check those checkboxes which are coming as selected. please help!
Thanks
checkedproperty tocategories, and then use that to manage checked unchecked objects...