From 6983e8d8001f8315527ec9c70b290c034779bedf Mon Sep 17 00:00:00 2001 From: Slava Kim Date: Sat, 16 May 2015 23:49:55 -0700 Subject: [PATCH] Update Spacebars REAMDE: mention nested sub-expressions --- packages/spacebars/README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/packages/spacebars/README.md b/packages/spacebars/README.md index eeabe0f9d0..65f278608a 100644 --- a/packages/spacebars/README.md +++ b/packages/spacebars/README.md @@ -495,6 +495,25 @@ We can write {{foo}} and it doesn't matter. Comment tags can be used wherever other template tags are allowed. +## Nested sub-expressions + +Sometimes an argument to a helper call is best expressed as a return value of +some other expression. For this and other cases, one can use parentheses to +express the evaluation order of nested expressions. + +```handlebars +{{capitalize (getSummary post)}} +``` + +In this example, the result of the `getSummary` helper call will be passed to +the `capitalize` helper. + +Sub-expressions can be used to calculate key-word arguments, too: + +```handlebars +{{> tmpl arg=(helper post)}} +``` + ## HTML Dialect Spacebars templates are written in [standard