Skip to content

Conformance Examples 0.1.0 — Environment Properties: assign-local

assign-local-read

A @local assignment is readable as @local/name.

Template

{{= @local/t = "Lo" }}{{ @local/t }}

Output

Lo

assign-local-visible-in-nested-with

A @local assignment is visible inside a nested #with block.

Template

{{= @local/t = "Lo" }}{{#with inner }}{{ @local/t }}{{/with}}

Context

{
    "inner": {
        "z": "Z"
    }
}

Output

Lo

assign-local-dropped-after-with

A @local assignment made inside #with is gone after the block.

Template

{{#with inner }}{{= @local/t = "Lo" }}{{/with}}{{ @local/t }}

Context

{
    "inner": {
        "z": "Z"
    }
}

Output


assign-local-not-surviving-each

A @local assignment inside #each does not survive the iteration.

Template

{{#each items }}{{= @local/x = this }}{{/each}}{{ @local/x }}

Context

{
    "items": [
        "a",
        "b",
        "c"
    ]
}

Output


assign-local-missing-empty

An unbound @local read renders empty.

Template

{{ @local/nope }}

Output


Source fixture: env-properties/assign-local.json