{{#case expr}}

  • function

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

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


  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.



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: