You should use ng-class : https://docs.angularjs.org/api/ng/directive/ngClass
Example:
css:
.red {
background-color: red;
}
.blue {
background-color: blue;
}
angular view:
<td ng-class="{'red': (variable == 1), 'blue': (variable ==2)}">{{data.material_or_service}</td>
EDIT:
Try that first:
<div ng-class="{'red' : (test != null)}">
hey !
</div>
<div ng-class="{'red' : (test == null)}">
hey 2 !
</div>
and set up .red { background-color: red; } in the css. Hey2 is supposed to be in red.
EDIT 2:
Now try with :
<table>
<tr>
<td ng-class="{'red' : (test == null)}">
hey !
</td>
</tr>
</table>
The <td> is red.
ng-classwhich allows you to set a class to a DOM element with condition