-
<div>
<% it.users.foreach((user) => { %>
<h1><%= user.name %> <%= user.age%></h1>
<input type="checkbox" checked="<%= user.verified %>" />
</div> I was wondering how make that checkbox input dynamic. The above is always checked because as long as checked attribute is set to some value, it will always be checked. I would like to not render Essentially, I am trying to replicate the following (React): <div>
{users.map((user) => (
<h1>{user.name} {user.age}</h1>
<input type="checkbox" checked={user.verified} />
))}
</div> Any help is appreciated 😄 |
Beta Was this translation helpful? Give feedback.
Answered by
jcbbb
Apr 23, 2021
Replies: 1 comment
-
Oh never mind, I found the answer. In case anyone comes across this, I did the following: <div>
<% it.users.forEach((user) => { %>
<h1><%= user.name %> <%= user.age%></h1>
<input type="checkbox" <%= user.verified ? "checked" : "" %> /> <% })
%>
</div> |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
jcbbb
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oh never mind, I found the answer.
In case anyone comes across this, I did the following: