0
<td class="text-center">

Is there a way to call a class in the above <td> tag based on a condition (Boolean value check)? I want to add "pointer" to the class call if the condition is true and leave it as "text-center" if it is false... like below:

if condition is met:

<td class="pointer text-center">

if condition is not met:

<td class="text-center">
j08691
  • 204,283
  • 31
  • 260
  • 272
  • Angular: https://stackoverflow.com/questions/35269179/angular-conditional-class-with-ngclass AngularJS: https://stackoverflow.com/questions/16529825/angularjs-ngclass-conditional This might be work you – Strider Apr 01 '22 at 11:16

1 Answers1

0

What you want is ng-class

The following example uses a $scope variable conditionIsMet

<td ng-class="{'pointer': conditionIsMet}" class="text-center">
Kinglish
  • 23,358
  • 3
  • 22
  • 43