I have the following json and suppose that I can't modify it:
{
"structure": [
{"property": "propA"},
{"property": "propB"}
],
"data": {
"propA": 7,
"propB": "something"
}
}
Now the template:
{{each structure}}
<span>${data.开发者_运维问答$value.property}}</span>
{{/each}}
What I want to achieve is that where I do ${data.$value.property}}
have the same result as if I do ${data.propA}
Issue: I don't know that "propA" exists whithin the "data" json. I have to access that part dinamically
thanks in advance!
Try this:
<span>${data[$value.property]}}</span>
精彩评论