<li class="<%= selected.indexOf(contentGroups) ? "selected" : ""%>">
Should work, but doesn't because indexOf does not read the length property of the array. We should modify this so it should. We should do the same for any other similar non-modifying method.
Issue sorted out indexOf is live bindable.