{{#case expr}}

  • function
can.stache.helpers.case  

{{#case expr}}BLOCK{{/case}}

Renders the BLOCK when expr matches the expr provided in the parent {{#switch expr}}.

Parameters

  1. expr {can.stache.expression}

    An expression or key that references a value.

  2. 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 an expr that will be matched against the case expr and if they are equal the block will be returned.

For more information on how {{#case}} is used check: