Search code examples
ember.jssproutcorehandlebars.js

How to do commenting in emberjs script handlebars?


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>

Solution

  • 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>