BorisMoore / jquery-tmpl

The original official jQuery Templates plugin. This project was maintained by the jQuery team as an official jQuery plugin. It is no longer in active development, and has been superseded by JsRender.
3.23k stars 1.01k forks source link

incorrect check in array processing #158

Closed AndreiBozantan closed 4 years ago

AndreiBozantan commented 12 years ago

Not all array values are converted to template items. This is due to an incorrect check on line 148: return dataItem ? newTmplItem( options, parentItem, tmpl, dataItem ) : null; This should be changed to return dataItem != null ? newTmplItem( options, parentItem, tmpl, dataItem ) : null;

Steps to reproduce: HTML: <div id="tmpl"><div>${}

</div> JavaScript: $('body').append($('#tmpl').tmpl([0, 1, 2, 3])); The problem is that the fist element in the array (0) is not rendered.

rdworth commented 12 years ago

Thanks for taking the time to submit this issue. Just wanted to let you know this plugin is no longer being actively developed or maintained by the jQuery team. See README for more info.