avi
avi

Reputation: 222

Add class to a html element dynamically

In the below code i want to add class to those row in which notes are more than 20.is there any way to add class according to my reqirement

<td> {{ participant.ParticipationRole }} </td>
                            <td> {{ participant.AvailableDate | date: "dd-MMM-yyyy" }} </td>
                            <td> {{ participant.Notes | limitTo: 20 }} {{participant.Notes.length < 20 ? '' : '...'}}</td>

Upvotes: 0

Views: 47

Answers (1)

Use ng-class :

<td ng-class="{ 'myClass': participant.Notes.length < 20 }"> Data </td>

Upvotes: 1

Related Questions