You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
After discussion with vitaut, we've decided to drop `as` before the arguments because of its resemblance with iteration (`each`).
The other change is the diff is clarification of the name binding that happens and an example to showcase the behavior.
Reviewed By: yoney
Differential Revision: D68864499
fbshipit-source-id: 7d98f6d970efd6609aa8af57d34cbcd11022895e
`{{#let partial}}` blocks and `{{#partial}}` statements have not been implemented yet.
629
-
:::
630
-
631
-
Partial blocks allow defining reusable templates within a Whisker template. They are not rendered unless *applied* (by name). A simple example of a `{{#let partial}}` block might be:
627
+
Partial blocks allow defining reusable templates within a Whisker template. They are not rendered unless *applied* (by name).
628
+
The following example of a `{{#let partial}}` block defines a partial named `greeting` that accepts a single argument named `person`:
Partial blocks must be applied with`{{#partial ...}}` statements. A simple example for a `{{#partial}}` statement for the above block might be:
636
+
Partial blocks must be rendered using`{{#partial ...}}` statements. A simple example of a `{{#partial}}` statement for the above block might be:
640
637
641
638
```handlebars
642
639
{{#partial greeting person=person}}
643
640
```
644
641
645
-
The `{{#partial}}` statement must include named arguments that are [bound](#scopes) to `expression`s, matching the captures (`as |...|`) from the definition.
642
+
The `{{#partial}}` statement must include all named arguments from the partial block being applied.
643
+
Each named argument is an `expression`, which is [bound](#scopes) to the corresponding argument (matching `|...|`) from the partial block.
646
644
647
645
The contained body of the `{{#let partial}}` block is rendered with a [derived evaluation context](#derived-evaluation-context). Names accessible from the site of the application are **not***implicitly* available within the block.
The name of a partial block is [bound](#scopes) to an [object](#data-model) in the current evaluation context, meaning it follows normal [name resolution rules](#evaluation-context). As a result, a partial block can be passed around like any other object.
0 commit comments