I have a JSON:
{
"providers" : {
"visa" : {
"name" : "VISA",
"type" : "card",
"enabled" : true,
},
"qiwi" : {
"name" : "QIWI",
"type" : "digital",
"enabled" : true,
},
…
}
}
I can render this and get name
, type
, enabled
.
-each item in providers
tr
td enabled: #{item.enabled}
td name: #{item.name}
td type: #{item.type}
td id: ???
But how can I get object names – “visa” or “qiwi” – in template?
Try this;
-each item, key in providers
tr
td enabled: #{item.enabled}
td name: #{item.name}
td type: #{item.type}
td id: #{key}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.