【发布时间】:2012-11-20 12:32:27
【问题描述】:
我使用jade作为express.js视图引擎,我使用Micro-Templating;这是我遇到的一个问题 这是模板
script(id='form',type='text/html')
select(id='select_category',name='product_category')
option <%= option%>
使用模板
$(tmpl('form',{'option':'something'}))
现在我有不止一个选择,所以这就是我所做的
我改变了模板
script(id='form',type='text/html')
select(id='select_category',name='product_category')
each val,key in <%= option%>
option <%= val%>
使用
$(tmpl('form',{'option':[some arr]}))
这会导致错误提示“Unexpected token
那我该怎么做呢?
【问题讨论】:
标签: node.js pug templating