I am having trouble getting an alternate-row css class applied to a knockout template with a foreach binding context. I am using knockout 2.1 with the available $index
context variable.
This is whats confusing:
My Template
<li class="row" data-bind="css: { alt: $index%2 }"></li>
results in no alt
classes being applied, however:
<li class="row" data-bind="text: $index"></li>
works properly and displays the row number.