{{#let}}

Binds expressions to local block-scoped names within a template.

Since Ember 4/5 (Octane) Spec ↗

Syntax

{{#let expr1 expr2 as |name1 name2|}} ... {{/let}}

Returns

block — Renders the block with the named locals.

Examples

{{#let
  (concat @user.first " " @user.last)
  (if @user.admin "Admin" "Member")
  as |fullName role|
}}
  <p>{{fullName}} ({{role}})</p>
{{/let}}

Notes

{{#let}} avoids repeating complex expressions and improves readability. It does not create reactivity by itself; the bound values stay reactive if their sources are tracked.