Support rendering of JSON arrays
See original GitHub issueIt would be great if one can render such arrays (key need for my application case):
'content': [
"Das ist ein langer Satz",
"Das ist ein zweiter langer Satz",
],
'people' : [
{
'name': "John(DE)"
},
{
'name': "Tim(DE)"
}
]
with an expression like:
<span translate="content[0]"></span>
<span translate="people[0].name"></span>
See (not working) example: http://plnkr.co/edit/u2Z3l2?p=preview
Issue Analytics
- State:
- Created 9 years ago
- Comments:24 (5 by maintainers)
Top Results From Across the Web
How to render array of JSON data in React Redux
Merge all object, into one by spreading the array into Object#assign · Add the length property · Convert back to an array using...
Read more >Dynamically Rendering JSON Objects in Arrays in React JS ...
Dynamically Rendering JSON Objects in Arrays in React JS Components Iterating Over an Array with J · Key moments. View all · Key...
Read more >Iterate Through a JSON Response in JSX Render for React
Building scalable apps requires handling and displaying JSON responses. This guide covers how to loop over an array of objects and render ......
Read more >Iterate over JSON array to render components from your ...
I want to render components dynamically depending on an array stored in a local JSON file. At this point, you can say, “Man,...
Read more >Array Example - JSON Forms
The array renderer is used, when an object with type array is used. To get a good overview, have a look at the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It would also be great if I could get the array.
and in the controller:
and the corresponding view
@nikolayhg
the keys are being “flattened”, so just change your notation to “invalid” path, like so: http://plnkr.co/edit/K3pbBD7hJcjHJrjo1X4C?p=preview
tl;dr
use
array.index.property
, notarray[index]property
, likepeople.0.name
i’d love, however, to get the full array, as in @Swissbite example - currently struggling with that…