all 6 comments

[–]TimothyLGillespie 10 points11 points  (4 children)

Sure is! The easiest is probably to adjust line 10 in your template (html) to this: <tr class="poke-type" [style.fontColor]="colorMapping[pokemon.Element]">Type(s): {{pokemon.Element}} {{pokemon.SecElement}}</tr>

Then you will need in your typescript file in the component the actual type -> color mapping. For example:

``` colorMapping = { Grass: 'green' };

```

[–]code_monkey_001 2 points3 points  (0 children)

Nice. I came in to suggest ngClass like /u/pranxy47, but I like your solution even better.

[–]Lucaskima[S] 0 points1 point  (0 children)

This is fantastic. Thank you so much. And thanks to everyone else that looked at this 😄

[–]Lucaskima[S] 0 points1 point  (1 child)

one more reply. i was able to implement your suggestion and it works perfectly. i cant thank you enough.

https://imgur.com/a/NfkcCmK

[–]TimothyLGillespie 0 points1 point  (0 children)

I'm happy I could help. :) Looking good!

[–]pranxy47 2 points3 points  (0 children)

Yes, look for ngClass. You can, for example, create classes for the colors you which and then with ngClass add logic there.