I want to change the text color of a row in an HTML table using jQuery if it founds this characther "-". The data is coming from a webservice and I'm using AngularJS but I don't know if I have to use directive to do this.
This is my angular expression:
<td>{{example.name}}</td>
and this is what I tried:
$('.example.name').each(function() {
if($(this).contains(-)) {
$(this).css('color', 'red');
}
});
I put this code inside the controller that is bringing the data but it's not working, that's when I thought in directives.
So how can I achive this