Change icon on condition

i want to change icon on basic of some string value
fruit is variable
and value of the fruit variable is apple than icon is apple. if value is mango than icon should be mango.
how to change icon like this?

have your tried something like this:


but where is icon class

If your icon class is identical with your fruit-value -> it adds the fruitname as class.

in other cases you have to ugly write:
ng-class="{‘apple’: fruitVariableName === ‘apple’, ‘mango’: fruitVariableName === ‘mango’}"