mikeric/rivets — pull request #48 by mikeric (2012-08-09 03:20:28+00:00)
Title: Iteration binding

This is the *initial implementation* of the `data-each-[item]` binding.

```

```

Binding on iterated items works as expected. They will update when any of the iterated items trigger changes, as well the entire iterated set will update when the array itself triggers changes.

If the array you're binding to contains *non-model* objects (they don't conform to your adapter), you can still iterate over them, just make sure to use the adapter bypass syntax (it will only get updated when the actual array is changed instead of a per item basis).

```

```

#### Caveats to be addressed before this is merged in

- The original element is still in the DOM as it's used as a marker (it is just hidden). This should get replaced with a comment as a marker instead.
- Binding to objects that are from the parent scope aren't getting set on the initial binding, but they do get updated when the array changes.
- When the array changes, all the elements get removed and the full collection is re-rendered/binded. Ideally only new and removed items will be added/removed (it would have to somehow account for sorting as well).