How to use comments in Handlebar templates?

Abhidev picture Abhidev · Mar 11, 2013 · Viewed 55.6k times · Source

I am using Handlebar.js as my templating engine. Now I want to comment out some of the blocks in my handlebar templates. But then I realized that Handlebar doesn't ignore the expressions inside the Handlebar comment block. Any workaround for this?

Answer

jptsetung picture jptsetung · May 27, 2013

The newest version of Handlebars has block comments support :

{{!-- {{commented expressions}} --}}

https://github.com/wycats/handlebars.js/commit/a927a9b0adc39660f0794b9b210c9db2f7ddecd9