How to do commenting in emberjs script handlebars?

Kapil Garg picture Kapil Garg · Mar 27, 2012 · Viewed 11.8k times · Source

Can anybody tell me how to include commented code in emberjs handlebars templates?

  <script id="restaurantDetail" data-template-name='restaurantDetail' type="text/x-handlebars">
//Commented code goes here
</script>

Answer

D.Shawley picture D.Shawley · Mar 27, 2012

From the looks of the github page, you want {{! comment text here}}:

Comments

You can add comments to your templates with the following syntax.

{{! This is a comment }}

You can also use real html comments if you want them to end up in the output.

<div>
    {{! This comment will not end up in the output }}
    <!-- This comment will show up in the output -->
</div>