Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to add non html comment in underscore.js or lodash templates?

Tags:

Is it possible to add non html comments in underscore.js or lodash ?

Something like :

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

So that the comment is not in the resulting generated html code ?

If I write :

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

The comment is in the resulting html.

Thank you.

like image 644
Raphaël Lemaire Avatar asked Feb 22 '13 11:02

Raphaël Lemaire


Video Answer


1 Answers

It is a client side template, you'll still see the comment, but it won't repeat etc...

<% // comments go here %> 
like image 150
Shanimal Avatar answered Sep 20 '22 21:09

Shanimal