Using ng-style for a boolean variable within a ng-repeat angularjs

0

I have a listing like this:

<tr md-row md-select="cali" md-select-id="name" md-auto-select ng-repeat="cali in vm.calibracoes">
           <td md-cell>{{cali.idCalibracao}}</td>
           <td md-cell>{{cali.pessoa.nome}}</td>
           <td md-cell >{{cali.ativa? 'Sim' : 'Não'}}</td>
           <td md-cell>{{cali.dataCalibracao | date:'dd/MM/yyyy'}}</td>
           <td md-cell>{{cali.dataProximaCalibracao | date:'dd/MM/yyyy' }}</td>
           <td md-cell>

        </td>
 </tr> 

How do I leave the 'Yes' in blue and the 'No' in red? Using ng-style or ng-class ? I have never used these angle features

    
asked by anonymous 01.12.2018 / 18:55

1 answer

0

I was able to resolve it as follows:

 <td md-cell ng-style="{ 'color' : (cali.ativa) ? 'blue' : 'red' }">{{cali.ativa? 'Sim' : 'Não'}}</td>
    
01.12.2018 / 20:03