Tutorial: Description fix - each block bindings ()

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/6374/head
Kai 4 years ago committed by GitHub
parent ad29604d6b
commit 1a1f36edcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -5,15 +5,17 @@ title: Each block bindings
You can even bind to properties inside an `each` block.
```html
<input
type=checkbox
bind:checked={todo.done}
>
{#each todos as todo}
<input
type=checkbox
bind:checked={todo.done}
>
<input
placeholder="What needs to be done?"
bind:value={todo.text}
>
<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.
> 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