2
I need to group the Class field and list the tasks that exist, but I can’t do that with Angularjs.
Here is my view:
<div class="row">
<div class="col-md-12">
<div ng-controller="atividadesDisciplinaController">
<table class="table table-bordered table-condensed table-hover table-striped">
<thead>
<tr>
<th>Recurso</th>
<th>Visualizações</th>
<th>Interações</th>
<th>Último Acesso</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="x in disciplinas">
<td>@{{ x.recurso }}</td>
<td>@{{ x.visualizacao }}</td>
<td>@{{ x.interacao }}</td>
<td>@{{ x.ultimo_acesso }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
Here I list the Controller that receives a JSON:
<script>
app.controller('atividadesDisciplinaController', function($scope, $http) {
$http.post("/disciplina/{{ $slug }}/relatorios/{{$relatorio}}")
.then(function (response) {$scope.disciplinas = response.data;});
});
</script>
Today you’re listing it as.
And I need you to stay more or less like this
I tested using Angularjs documentation:
<tr ng-repeat="x in disciplinas | groupBy: 'aula'">
<td>@{{ x.recurso }}</td>
<td>@{{ x.visualizacao }}</td>
<td>@{{ x.interacao }}</td>
<td>@{{ x.ultimo_acesso }}</td>
</tr>
And a mistake returns:
Unknown provider: groupByFilterProvider <- groupByFilter
Thanks for your help, but I tested it with grouBy and it gives me an error. Error: [$injector:unpr] Unknown Provider: groupByFilterProvider <- groupByFilter
– Jonathan Augusto Halberstadt
@Jonathanaugustohalberstadt you added the script import and the module?
– Sorack
I remade it like you said and now you’re returning another error. I don’t know much about this, can you explain to me how I bring the disciplines instead of using that push you did? angular.js:12221 Error: [ng:areq] Argument 'Controllertabelas' is not a Function, got Undefined
– Jonathan Augusto Halberstadt
I did not understand. It was marked as accepted answer but you managed to solve the problem?
– Luciano Oiticica Lemgruber