I am currently creating an array of active and inactive users and was wondering if it would be possible to style specific rows in a table based on whether or not said Users are active or inactive.
Can you attach a style to an array in Angular? For example, say I'm retrieving data from a database of students and depending on whether or not they're active/inactive, I can apply a style to that row on the fly?
An easy way may be to create two separate array for the students and then apply the style depending on which array we're targeting but if I wanted to save some space and keep everything in one array, would there be a way of doing so?
Here is some code:
<user-table [loadingError]="_loadingError"
[loading]="_loadingUsers"
[users]="_users">
</user-table>
_users is the array that I create in the corresponding TypeScript file. Would I able to say something like,
If ([users].firstName == 'John') apply johnStyles from .less file
I can clarify if need be.