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?
相关问题
- Views base64 encoded blob in HTML with PHP
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
Just add an exclamation mark after the opening brackets.
Normal Expression:
Commented Expression:
Use this code:
The newest version of Handlebars has block comments support :
https://github.com/wycats/handlebars.js/commit/a927a9b0adc39660f0794b9b210c9db2f7ddecd9
Use this way in your handlebar template file.
The comments will not be in the resulting output. If you'd like the comments to show up, then use HTML comments.
refer this link to