<% data.who.forEach(function(myself){ %> <%= my" /> <% data.who.forEach(function(myself){ %> <%= my" /> <% data.who.forEach(function(myself){ %> <%= my"/>

Doing native javascript inside of a JST backbone.js template

152 Views Asked by At

I am trying to do a loop inside of a JST file:

data.who

["Arthur", "Craig", "Dan", "Daniel"]

JST

<date><% data.who.forEach(function(myself){ %>
    <%= myself %>
<%  }) %></date>

No idea and couldn't find loops in the document ion for JST, just trying to apply logic from PHP.

1

There are 1 best solutions below

0
Jamie Hutber On BEST ANSWER

Turns out I was a little bit silly, but data was not defined inside the JST

Make sure you have defined it inside of your view calling the JST