2013-10-22 51 views
5

在我的小鬍子模板中,我想評論幾行,但我無法做到。我仍然收到HTML中顯示的評論。什麼是添加評論的正確方法?任何人都可以幫我解決這個問題嗎?如何將評論添加到小鬍子模板中?

這裏是我的代碼:

<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> 
+0

您是否嘗試過使用{{! }}而不是多行註釋? – rivarolle

+0

我試過但沒有工作。 – 3gwebtrain

+0

你可以評論整個HTML元素,它不會顯示(使用'') –

回答

10

鬍子documentation建議使用以下意見:

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. 

我認爲你的情況,你不得不使用

{{! blah }} 

相反

{{!-- blah --}}