SteveSanderson/knockout — Issue #281: request: $loop pseudovariable in foreach binding
Author: pegler
Created: 2012-01-15 07:42:18+00:00
State: open

It would be incredibly useful if there was some way to get the index, and if the item is first/last in the list. Django does this with the variable forloop, and attribute forloop.first, forloop.last, forloop.index. This makes things such as numbering the rows in a table and avoiding a trailing comma in a list easier/not impossible.

I read the docs and didn't see this anywhere. Would be a great addition to KO.