What is the best way to express this in Aurelia v.1

ng-class="['even', 'odd'][$index %2]"

(in use in a <tr repeat.for="...">)

Is it almost directly translateable, i.e. swap ng-class with class or is there another/better way? Or should these things perhaps be handled using CSS, e.g. tr:nth-child(odd) ?

1 Like

class=“${$even?’even’:’odd’}”

$even an $odd are contextual variables in a repeater

4 Likes

@MaximBalaganskiy Sweet!

(Btw, I should have remembered that. I believe it is mentioned in the cheat sheet, isn’t it?)

2 Likes