-2

I know that there are lots of similar questions on SO but none of the ones I checked could fix my issue.

I used this JSFiddle referenced in this SO Answer about Underscore templating.

So here is my template:

        <script type="text/html" id="forecastTemplate">
            <table class="forecast-table">
                <tbody>
                 <% _.each(items,function(item,key,list){ 

                    var day = moment.unix(item.dt).format("ddd");
                %>
                <tr>
                    <td><%= day %></td>
                    <td><span><%= item.temp.min %></span><span class="wi wi-celsius"></span></td>
                    <td><span><%= item.temp.max %></span><span class="wi wi-celsius"></span></td>
                    <td><span class="wi wi-rain"></span></td>
                </tr>
                <% }); %}
                </tbody>
            </table>
        </script>

It seems clear that the issue is with the _.each line but I can't see where the problem is...

Do you guys see what I can't?

Georges Legros
  • 2,494
  • 2
  • 23
  • 42

1 Answers1

1

At the end, you have <% }); %} where it should be <% }); %> ;)

jeroen e
  • 144
  • 6