How to add comments to the mustache template?

In my Mustache template, I would like to comment on a couple of lines, but I cannot do this. I am still getting comments displayed in HTML. What is the correct way to add comments? Can anyone help me sort this out?

here is my code:

<script type="text/html" id="inspector-splitViewBase"> <div class="inspector-split-view-container flex-1 flex-fill flex-down"> <header class='split-view-inspector-header'> <div class="view-title">Source Assets</div> {{!-- <div class="actions"> commented <span class="label">Actions</span> <span class="gear"></span> </div> --}} - comment is not working </header> <div class='search-container'> <span class="search-icon"></span> <input type="text" value="" class="inspector-search" /> </div> <div class="source-assets-list-container flex-1"></div> <footer></footer> </div> </script> 
+6
source share
1 answer

Mustache documentation suggests using the following comments:

 Comments begin with a bang and are ignored. The following template: <h1>Today{{! ignore me }}.</h1> Will render as follows: <h1>Today.</h1> Comments may contain newlines. 

I assume that in your case you had to use

 {{! blah }} 

Instead

 {{!-- blah --}} 
+10
source

Source: https://habr.com/ru/post/956481/


All Articles