Tutorial: Description fix - each block bindings (#5974)

The chapter highlights event binding in `each` block which is missing within the snippet. Thus it seems reasonable to include it within the description snippet block.
pull/7738/head
Kai 5 years ago committed by GitHub
parent 6ae5b6d5d0
commit 795f19ede1

@ -5,15 +5,17 @@ title: Each block bindings
You can even bind to properties inside an `each` block.
```html
<input
{#each todos as todo}
<input
type=checkbox
bind:checked={todo.done}
>
>
<input
<input
placeholder="What needs to be done?"
bind:value={todo.text}
>
>
{/each}
```
> Note that interacting with these `<input>` elements will mutate the array. If you prefer to work with immutable data, you should avoid these bindings and use event handlers instead.
Loading…
Cancel
Save