I would like the odd table rows to bee colored. Angular has ng-class-odd and ng-class-even that works inside the scope of ng-repeat.
Can I somehow get the index of the repeat-for function in Aurelia?
There is $even and $odd properties that is available on the items in an repeat.for binding.
You could conditionally apply a class like this -
<ul>
<li repeat.for="item of items" class="${ $even ? 'my-class': '' }"></li>
</ul>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With