Skip to content

Commit 1c8a71b

Browse files
author
Cerem Cem ASLAN
committed
added optional apporach
1 parent d8335f3 commit 1c8a71b

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

doc/Ractive/temporary-variables-inside-each-loop.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@
88
{{/with}}
99
{{/each}}
1010

11-
`myobj` is not polluted with the `tmp` variables.
11+
`myobj` is not polluted by the `tmp` variables.
1212

13-
(see https://gitter.im/ractivejs/ractive?at=5f3decae33878e7e602e58d7)
13+
(see https://gitter.im/ractivejs/ractive?at=5f3decae33878e7e602e58d7)
14+
15+
> If you prefer to fill your original object permanently with the generated values,
16+
> use `{{@context.set()}}`:
17+
>
18+
> {{#each myobj}}
19+
> {{@context.set('.tmp', (.foo !== 'bar')) && ''}}
20+
>
21+
> <!-- attention to the dot in front of variable -->
22+
> <li>{{.hello}} tmp is: {{.tmp}}</li>
23+
>
24+
> {{/each}}

0 commit comments

Comments
 (0)