2013-02-22 100 views
17

是否可以在underscore.js或lodash中添加非html注释?是否可以在underscore.js或lodash模板中添加非html注释?

喜欢的东西:

<%-- We do this here because... %> 

这样的评论是不是在导致生成的HTML代码?

如果我写:

<!-- We do this here because... --> 

的评论是在生成的HTML。

谢谢。

+1

你的意思是一个模板里面?如果没有,只需使用JS评论 – Bergi 2013-02-22 12:08:34

回答

24

它是一个客户端模板,你仍然会看到评论,但不会重复等等

<% 
// comments go here 
%> 
相关问题