I have this set JSON data
JSON
[{
"country": {
"name": "Malaysia",
"total_amount": 0.0,
"count": 0
}
}, {
"country": {
"name": "Philippines",
"total_amount": 0.0,
"count": 0
}
}, {
"country": {
"name": "Thailand",
"total_amount": 0.0,
"count": 0
}
}]
Let say this data I sent it like
.replaceWith(@template(data: @data_transaction)
How do I retrieve the data inside the template.jst.eco
I have tried to use this kind of for loop
<% for key, data in @data_transaction.models: %>
<%= data.get("country").name %>
<%= data.get("country").total_amount %>
<%= data.get("country").count %>
it just does not work
if I tried to print it out this way inside the template.jst.eco
<%= @data_transaction %>
it will show this kind of things
[object, object]
Any helps?
Thank you very much