I have two High and Low buttons, I want that at the beginning when all are true only the Low button is seen and if one is in FALSE the High button is seen
<table class="table table-sm" ng-init="GetData()">
<thead>
<tr>
<th>Dirección</th>
<th>Estado</th>
<th></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="l in List">
<td>{{l.Direccion}}</td>
<td><i ng-class="l.Estado ? 'btn btn-info btn-sm' : 'btn btn-danger btn-sm'"><b>{{l.Estado ? 'Activo' : 'Inactivo'}}</b></i></td>
<td>
<button type="button" class="btn btn-success btn-sm" ng-click="VerIglesia(l.Id)">
<span class="fa fa-eye" aria-hidden="true"></span>
</button>
<button type="button" class="btn btn-warning btn-sm" ng-click="Editar(l.Id)">
<span class="fa fa-pencil" aria-hidden="true"></span>
</button>
<button type="button" ng-hide="btnAlta" class="btn btn-info btn-sm" ng-click="Alta(l.Id)">
<span class="fa fa-angle-up" aria-hidden="true"></span>Alta
</button>
<button type="button" ng-hide="btnBaja" class="btn btn-danger btn-sm" ng-click="Baja(l.Id)">
<span class="fa fa-angle-down" aria-hidden="true"></span>Baja
</button>
</td>
</tr>
</tbody>
</table>
Here I can see some that are active and others inactive
Use on the two buttons you want:
This should work.
(I left out some of the code to show only what is relevant to the question)
If I understand correctly your buttons depend on the property
.Estado
of each element of your list. Thus, your HTML should be something like:For me you should perform an ng-if in your query
So when you have:
You can differentiate the condition using the ng-if function.
Greetings boss.
Why not add a class to the [disabled] attribute?
In HTML:
In CSS: