Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can you tell me how can I loop this in this template? #47

Closed
cruel32 opened this issue Mar 17, 2018 · 1 comment
Closed

Can you tell me how can I loop this in this template? #47

cruel32 opened this issue Mar 17, 2018 · 1 comment

Comments

@cruel32
Copy link

cruel32 commented Mar 17, 2018

-json

{
    "name" : "csh",
    "eachTest" : [
        {"value":1},
        {"value":2},
        {"value":3},
        {"value":4}
    ]
}

-html

<body>
 <%= name %> <!-- this output is correct-->
 <%= eachTest %> <!-- this output is not what you want. No loop. --> 
</body>

__

@cruel32 cruel32 closed this as completed Mar 17, 2018
@kevinchappell
Copy link

For anyone else that finds this closed issue without resolution:

<ul>
<% _.forEach(eachTest, function(test) { %>
  <li><%- test.value %></li>
<% }); %>
</ul>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants