Solicito de su ayuda debido a que no he logrado hacer binding entre varios checkbox y los datos. Lo he intentado de varias formas y este ha sido mi resultado:
HTML
<label ng-repeat="teams in teams" class="checkbox-inline">
<input type="checkbox"
value="{{teams.name}}" ng-model="data.id"> {{fruit.id}}
</label>
Controlador
$scope.teams = [
{ name: "Red", id: 0, },
{ name: "Blue", id: 1,},
{ name: "Green", id: 2,},
{ name: "Yellow", id: 3, },
{ name: "Orange", id: 4,},
{ name: "Purple", id: 5}
];
$scope.data = [0,1];
//Posible solucion:
$scope.selectF = function selectF(){
for (var i=0;i<data.length;i++){
for (var j=0;j<teams.length;j++) {
if(data[i].id === teams[i].id ){
return true;
}
return false;
}
}
}