mbest/knockout-repeat — pull request #7 by drosen0 (2012-08-14 19:53:45+00:00)
Title: Documentation clarifications

I think it would be helpful to explain the main differences between `repeat` and `foreach` near the top of the readme. Something like this:

> `repeat` can replace `foreach` in many instances and is faster and simpler for some tasks. In contrast to `foreach`:
> * `repeat` does not create a binding context. Therefore, the variables for the binding context (`$data`, `$parent`, and `$parents`) are unaffected. Instead, you can access the current item using `$item()` and `$index`.
> * `repeat` operates on the outer HTML instead of the inner HTML.
> * `repeat` can either loop a number of times (`count`) or iterate over an array or observableArray (`foreach`).

Also it would be nice to have example showing the use of `with`, `$item()` as a function, and a function without arguments using `$item()` within a `repeat`:

> You may use `with` to create a binding context in a `repeat` to get the equivalent functionality of a `foreach`. These three examples are equivalent:
>
> ```html
>

data-repeat-bind="css: { sel: $item() == selectedCountry() }">
>
>

> ```
> ```html
>

data-repeat-bind="css: { sel: $item() == selectedCountry() }, with: $item">
>
>

> ```
> ```html
>
>

>
>

>
> ```