Converting boolean to YES or NO in Angles

2

I have the following table structure on my form HTML :

<tbody>
    <tr nr-repeat="p in model.previdencias">
        <td>{{p.NomeDependente}}</td>
        <td>{{p.IsAtivo}}</td>
    </tr>
</tbody>

The p.IsAtivo attribute is of type boolean which returns true or false . I would like to make a ifinline to write Yes or No in the table column according to the value of the field. I did this, but it did not work:

<td>{{p.IsAtivo ? 'Sim' : 'Não'}}</td>

How do I do it?

    
asked by anonymous 13.12.2017 / 01:48

1 answer

2

I found the following link: angularjs-print-yes- or-no-based-on-boolean-value and resolved as follows:

<td>{{true == p.IsAtivo ? 'Sim' : 'Não' }}</td>
    
13.12.2017 / 02:42