1
Good morning I have several tables within a div, within these tables I show in the columns the days of the week, and in the rows several times. These times I limited to show only 8 at a time. When one clicks on the 'More' button, I show 8 more results. However, these 8 results also appear in the other tables. How do I make it appear only in the table I clicked on the button?
HTML is like this:
<table class="table table-bordered tabela" width="100%" style="margin-bottom: 0px; font-size:11px;">
<thead>
<tr>
<td><i class="fa fa-arrow-circle-left fa-2x"></i></td>
<td ng-repeat="dia in agenda.horarios">
<span tooltip-placement="top" tooltip="Retorno" tooltip-append-to-body="true" class="badge badge-warning days retorno">33</span>{{agendas.dia_semana[$index].dia_semana}}<span tooltip-placement="top" tooltip="Encaixe" tooltip-append-to-body="true" class="badge badge-warning days encaixe">33</span>
<br>
{{agendas.dia_semana[$index].data}}
<table class="table-striped" align="center" width="100%">
<tr ng-repeat="hora in dia | limitTo:quantidade" style="color:#03a9f4; border: 1px solid #ddd">
<td>
<div style="{{hora.color}}">{{hora.hora_agenda}}</div>
</td>
</tr>
<tr ng-show="dia.length > 0" style="color:#03a9f4">
<td><a style="cursor: pointer;" ng-click="mostrarMais();">Mais...</a></td>
</tr>
</table>
</td>
<td><i class="fa fa-arrow-circle-right fa-2x"></i></td>
</tr>
</thead>
</table>
And the Controller so:
$scope.mostrarMais = function(){
$scope.quantidade += $scope.quantidade;
}
I don’t know much about Angularjs but, it doesn’t allow to create several controllers? Logically, if you are using a single controller for the entire application, by changing one table the others (using the same controller) will also be affected.
– Renan Gomes