JSFiddle - React, Tailwind, and code Playground
HTML
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover" ts-wrapper>
<thead>
<tr>
<th width="3%" class="linha-tabela" ts-default>NÂş</th>
<th width="5%">Ausente</th>
<th ng-repeat="item in ocorrencias" style="cursor:pointer;" width="2%" title="{{item.descricao}}" alt="{{item.descricao}}">{{item.id}}</th>
<th>Nome</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="aluno in alunoFaltas" width="2%">
<td>{{$index + 1}}</td>
<td style="text-align: center;" width="12%">
<select ng-model="diario[$index]" ng-init="getSelectFaltas($index,aluno.id_pessoa)" name="diario_falta" id="diario_falta" class="form-control" ng-options="total.qtd for total in totalFaltas" ng-change="salvaFaltaAluno($index, aluno.id_pessoa)">
<option value="">Selecione</option>
</select>
</td>
<td ng-repeat="item in ocorrencias" width="2%">
<input ng-model="input[$parent.$index][$index]" ng-click="salvaOcorrencia(alunoFaltas[$parent.$index].id_pessoa, $parent.$index, item.id)" ng-checked="input[$parent.$index][$index]" type="checkbox" name="ocorrencia" ng-value="false" id="ocorrencia" >
</td>
<td>{{aluno.nome}}</td>
</tr>
</tbody>
</table>
</div>
JavaScript
//AQUI EU SALVO OS CHECKBOX
$scope.salvaOcorrencia = function(aluno,ocorrencia, item){
$timeout(function() {
$scope.input[ocorrencia]['id_aulas'] = $scope.id_aula;
$scope.input[ocorrencia]['id_ocorrencia_aula'] = item;
$scope.input[ocorrencia]['id_aluno'] = aluno;
$scope.json = angular.toJson($scope.input[ocorrencia]);
$http.post('../api/index.php/salvaocorrenciaaluno/', $scope.json,
{withCredentials: true,
headers: {'enctype': 'multipart/form-data' },
}
).success(function(data, status, headers, config) {
if (data.error == '0'){
$scope.input[ocorrencia]['id'] = data.id;
}
else {
console.log(data.error);
//toaster.error({title: "Sala Virtual", body:data.mensagem});
//Mensagem.error(data.mensagem);
}
}).error(function(data, status) {
});
console.log("Lista de ocorrencia",$scope.input[ocorrencia]);
}, 50);
}
//AQUI EU TRAGO, POREM, SE EU COLOCAR DESSA FORMA: input[0][2] = true; ELE ME DA COMO INDEFINIDO
$scope.getListaOcorrenciaAlunos = function(){
//ISSO DARIA UM ERRO: scope.input[0][2] = true
$http.get('../api/index.php/listaocorrenciaalunos/'+$scope.id_aula).
success(function(data, status, headers, config) {
if(data.error == 0){
console.log('ocorrencia',data.ocorrencia);
}
}).
error(function(data, status, headers, config) {
// log error
});
}