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
Nested object in array #93
Comments
Can you give me an example of what you are trying to output this as? This is not an array so you would want to use |
Hi, It's to display some profile information, e.g. JSON: postcode: "ABC 123"
region: "UK"
section: "Members"
sports:{
"0":"football",
"1":"golf",
"2":"basketball"
} HTML: <div class="inner" data-template>
<div class="thumbnail-name">
<img src="http://dummyimage.com/300/300/fff" alt="" data-src="{{image}}" />
<h3>{{section}} {{region}}</h3>
</div>
<ul>
<span>Sports</span>
<li>{{sports}}</li>
</ul>
</div> |
If you supply a Fiddle I could help you with this but this is a straight forward case of what I said. You need to handle the iteration of |
There were a few issues with your example including invalid JSON, lack of iteration etc. Here you'll find a working example: http://jsfiddle.net/mr_olafsson/67yreg0h/ Check out nested templates: http://tempojs.com/#nested-templates
|
Wow fixed the json and it works perfectly! Thanks for your quick replies and examples. Thanks for such a great tool. |
You're welcome! ;) |
How can I access the values of an object within my data array JSON?
e.g.
I have been using your nested examples but not having any luck getting it to work
The text was updated successfully, but these errors were encountered: