I would like to create a directive that can change the font color of the text displayed on a span based on some value that is not displayed.
I have an array:
You can use ng-class
{{somedue.date}}
where the classes red or black will be applied. You can style those via CSS to make the color red / black.
Example: http://jsfiddle.net/TheSharpieOne/NHS73/
Your data structure was odd in your example, it has been modified in mine to showcase ng-class
.
Also: You could use true
/ false
and not need to do a string comparison to 'yes'
/'no'
.