how to show json object key and value using handlebar template?

handlebars.js, jquery, json

Solution

You can render the keys/values of a list in a Handlebars template like this:

{{#each object}}
  {{@key}}: {{this}}
{{/each}}

Problem

I have started to learn handlebar.js . I am struggling to display json data . My json look like this: ``` var data={ "record1": [ { "first": [ { "name":"john", "city":"newyork" }, { "name":"britto", "city":"bangalore" } ] }, {"second": [ { "name":"franklin", "city":"newyork" }, { "name":"leo", "city":"bangalore" } ] } ] }; ``` here this json is coming from server response so I don't know any key and value. I have to show key and value dynamically by using handlebar ...I have tried with eachKey but I have not got solution for that . Can anyone help me?

Original source