How to use comments in Handlebar templates? Ask Question

How to use comments in Handlebar templates? Ask Question

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?

ベストアンサー1

The newest version of Handlebars has block comments support :

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

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

おすすめ記事