0

Is there any possibility to add CSS class "marked-row" to the TR-element in case if candidate.bl = TRUE ?

     <tbody>
        <tr data-ng-repeat="candidate in candidates | orderBy : orderByField : reverseSort">
            <td>{{candidate.fullname}}</td>
            <td>{{candidate.birthdate}}</td>
            <td><span ng-show="candidate.bl" class="glyphicon glyphicon-ok"></span></td>
        </tr>
    </tbody>

2 Answers2

0
    <tr ng-class="{'marked-row':candidate.marked}" data-ng-repeat="candidate in candidates | orderBy : orderByField : reverseSort">
        <td>{{candidate.fullname}}</td>
        <td>{{candidate.birthdate}}</td>
        <td><span ng-show="candidate.bl" class="glyphicon glyphicon-ok"></span></td>
    </tr>
Code Whisperer
  • 22,959
  • 20
  • 67
  • 85
0

try using ng-class

<tr data-ng-class="{'marked-row': candidate.bl}">

angular ng-class if-else expression

Community
  • 1
  • 1
dannypaz
  • 1,294
  • 1
  • 12
  • 16