Render array inside template
-
@psychobunny . Hi , I am trying to render an array inside a template , I have this code:
[code]
var data = {
results:[]
}
function renderTest( req, res, next) {
results = ['a','b','c','d'];
data.results = results;
res.render("mytemplate", data);
[/code]In the template.tpl I have:
{results.length}
<!-- BEGIN results -->
{results}
<!-- END results -->I get only 4 which is the length, I am unable to display the array content. Could you please help me how to do this ?
Copyright © 2024 NodeBB | Contributors