Hi,
I'm just playing with Mikado and I'm actually confused how includes work.
For this data..
{
"header": "List of users",
"users": [
{
"username": "User A0",
"tweets": [
"foo",
"bar",
"foobar"
]
},
{
"username": "User A1",
"tweets": [
"foo",
"bar",
"foobar"
]
}
]
}
I've created header.html that looks like this
row.html as a partial that looks like this
<tr>
<td>{{ data.username }}</td>
<td>{{ data.tweets.length }}</td>
</tr>
and list.html that looks like this
<div>
<div include="build/partials/header"></div>
<table>
<thead>
<tr>
<th>User</th>
<th>Tweet count</th>
</tr>
</thead>
<tbody include="build/partials/row"></tbody>
</table>
</div>
Questions:
- is there a way to set a context for include, like
context=data.users?
- it seems
include is only for enumerables, is there a way to have a "static" component?
Bug:
- if I put include in
table or even tbody tag, whole template is rendered for all rows, including header, is that a desired behavior? Or am I missing something?
Hi,
I'm just playing with Mikado and I'm actually confused how
includeswork.For this data..
I've created
header.htmlthat looks like thisrow.htmlas a partial that looks like thisand list.html that looks like this
Questions:
context=data.users?includeis only for enumerables, is there a way to have a "static" component?Bug:
tableor eventbodytag, whole template is rendered for all rows, including header, is that a desired behavior? Or am I missing something?