Closed isatrio closed 6 years ago
url is a property of audio, whereas the context in the loop is audio.datas. Try
{{for audios}}
{{for datas}}
{{:name}}
{{/for}}
{{:url}}
{{/for}}
Paul's approach is fine as long as you don't need to mix the two levels - as in:
name
url
name
If you do, then take a look at Accessing parent data for alternatives, such as:
{{for audio.datas ~url=audio.url}}
{{:name}}
{{:~url}}
{{:name}}
{{/for}}
or
{{for audio.datas ~audio=audio}}
{{:name}}
{{:~audio.url}}
{{:name}}
{{/for}}
Closing this - since the question is answered.
The object look like below
The template look like below
The audios.url can't show in the loop, the error is like "Uncaught TypeError: Cannot read property 'url' of undefined". Do you have suggestion for doing this?