baryshev / template-benchmark

111 stars 49 forks source link

gaikan's template is slightly wrong #11

Open ckknight opened 11 years ago

ckknight commented 11 years ago

Currently looks like:

<html>
    <head>
        <title>#{data.title}</title>
    </head>
    <body>
        <p>#{data.text}</p>
        <ins data-for="data.projects">
            <a href="#{data.url}">#{data.name}</a>
            <p>#{data.description}</p>
        </ins>
        <ins data-if="!data.projects">
            No projects
        </ins>
    </body>
</html>

If you see the data-if="!data.projects", that does not do a length check, so in the event that the template were passed an empty array, it would still not print out "No projects".