jsRender loop a List<string>

Blaise picture Blaise · Aug 6, 2012 · Viewed 8.2k times · Source

A question on the {{for}} loop in jsRender.

The demo shows we can loop through a collection of complex objects and display their properties:

{{for languages}}
    <div>
        <em>{{>name}}</em>
    </div>
{{/for}}

But what if my languages is only a List<string>? There will be no {{>name}} to be displayed. How can we reference the individual string values?

Thanks.

Answer

Jonas Geiregat picture Jonas Geiregat · Aug 22, 2012
{{#data}}

Didn't work for me.

Something seems to have been changed, this is what did it for me:

{{>#data}}