samedi 9 mai 2015

How to set ng-attr-title using ternary operator in Angularjs?

I am very new to Angularjs. I want to set a value for title attribute, based on a boolean variable.

Sample code attached here.

 <tr ng-repeat="doc in $data" ng-class="{{doc.is_today}} ? 'highlight' : ''" 
                                        ng-attr-title="({{doc.is_today}}) ? 'Today' : ''"> 
     <td>1</td>
     <td>2</td>
     <td>3</td>
     <td>4</td>
     <td>5</td>
</tr>

Thanks,

Aucun commentaire:

Enregistrer un commentaire