jeudi 7 janvier 2016

Angular: How to show icon.png depending on the attribute of a item?

I have an array of objects that looks like this:

[{"name":"Steve", "hourly_wage":16, "status":"part-time"},
{"name":"Maria", "hourly_wage":25, "status":"full-time"},
{"name":"Jose", "hourly_wage":21, "status":"former"}]

I want to display an icon for each person's employment status. A full circle for full time, a half circle for part time and an empty circle for former. How can I go about doing this in Javascript/Angular? I'm thinking an if statement of some sort inside ng-hide?

Aucun commentaire:

Enregistrer un commentaire