{{#case expr}}
can.stache.helpers.case
{{#case expr}}BLOCK{{/case}}
Renders the BLOCK
when expr
matches the expr
provided in the parent {{#switch expr}}.
Parameters
-
expr
{can.stache.expression}
An expression or key that references a value.
-
BLOCK
{can.stache(template)}
a template that will render if the case clause resolves.
Returns
{DocumentFragment}
A fragment, possibly containing the rendered BLOCK
.
The
case
helper is contextual inside of a {{#switch expr}} block. The parent switch contains anexpr
that will be matched against the caseexpr
and if they are equal the block will be returned.For more information on how
{{#case}}
is used check: