Ionic framework: Different background color for each list-item


#1

I would like to have a different background color for every list-item using ionic. For example a list of fruit containing: banana, apple, orange… For banana the background would be yellow For apple, it would be green For orange, it would be yellow …

Does anyone have an idea on how to achieve this?

I have tried to work with ng-style and ng-class but I did not succeed to obtain the wanted result.

I use collection-repeat for the list.

Thank you!

EDIT:

Answer here: