Skip to content

Conformance Examples 0.1.0 — Partials: context-argument

context-argument-partial-renders-against-pushed-context

A {{> key contextExpr }} partial renders against the pushed context argument instead of the current context.

Template

{{> who spouse }}

Context

{
    "name": "Outer",
    "spouse": {
        "name": "Inner"
    }
}

Partials

who:

{{ name }}

Output

Inner

context-argument-partial-pops-scope-after-rendering

After a context-argument partial renders, its pushed scope is popped and the outer context is restored.

Template

{{> who spouse }}/{{ name }}

Context

{
    "name": "Outer",
    "spouse": {
        "name": "Inner"
    }
}

Partials

who:

{{ name }}

Output

Inner/Outer

Source fixture: partials/context-argument.json