if
Renders an expression if a specific condition is true.
{{#if condition }}
expression
{{/if}}
Params
-
conditionexpression: The condition to evaluate.
Example
Compares two values, provided that the two values are of the same type.
{{#if product.price > 30 }}
product price more than 30
{{/if}}
elseif
{{#if product.price < 30 }}
product price less than 30
{{#else if product.price > 30 /}}
product price more than 30
{{/if}}
else
{{#if product.price < 30 }}
product price less than 30
{{#else/}}
product price more than 30
{{/if}}
Was this article helpful to you?