Articles in this section

Whitespace in handlebars expressions

Beware of whitespace lurking at the beginning of an expression. Whitespace placed before any symbol inside the handlebars will cause an error.

Correct:

{{expression}}{{dateFormat}}

Incorrect:

 {{ expression}}{{ dateFormat}} // note the leading whitespace

Error:

 {{expression {{field}} // second set of opening braces seen as new expression
Was this article helpful?
0 out of 0 found this helpful

Comments

1 comment
Date Votes
  • Suggestion: rename this article to "Whitespace in Handlebar Expressions" or something. I thought this was how to deal with data whitespace with handlebars (i.e., trimming string variables of whitespace)

    0

Please sign in to leave a comment.