{{concat}}

Joins multiple values into a single string in a template.

Since Ember 4/5 (Octane) Spec ↗

Syntax

{{concat value1 value2 ...}}

Returns

string — The concatenated string.

Examples

<img
  alt={{concat @user.first " " @user.last}}
  src={{concat "/avatars/" @user.id ".png"}}
/>

Notes

Handy for building attribute values and class lists from dynamic parts. For conditional class names, combine with {{if}}, e.g. {{concat "btn " (if @primary "btn-primary")}}.