{{#is(expressions)}}
Render something if two values are equal.
{{#is([EXPRESSION...])}}FN{{else}}INVERSE{{/is}}
Renders the FN
if every EXPRESSION
argument is equal (===
).
{{#is(user.type, "admin")}} <button/> {{else}} Login {{/is}}
{{#is(task.ownerId, task.assignedId, user.id)}} Delegate! {{/is}}
Parameters
- EXPRESSION
{Literal Expression|KeyLookup Expression|Call Expression}
:Two or more expressions whose return values will be tested for equality.
- FN
{sectionRenderer(context, helpers)}
:A subsection that will be rendered if each
EXPRESSION
argument is equal. - INVERSE
{sectionRenderer(context, helpers)}
:An optional subsection that will be rendered if one of the
EXPRESSION
arguments is not equal to one of the others.
Use
The is
helper compares expr1 and expr2 and renders the blocks accordingly.
{{#is(expr1, expr2)}}
// truthy
{{else}}
// falsey
{{/is}}