-1

I've fetched my data from backend and displayed it in console. Everything is perfect but I couldn't display it out in handlebars. here is my object,

how to render this data in handlebars

junaif
  • 51
  • 1
  • 5

1 Answers1

-1

For iterating list of object take a look that answer This might be helpful for you.

Instruction link

{
    person: {
         police: {
             firstname: "Yehuda",
             lastname: "Katz",
        },
         army: {
             firstname: "Yehuda",
             lastname: "Katz",
        }
   },
}

Iterate the Object by following

{{person.police.firstname}} {{person.army.lastname}}

For Iteration over list of object follow

<ul class="people_list">
    {{#each people}}
         <li>{{this.name}} is {{this.age}} year old.</li>
   {{/each}}
</ul>

Where people is like

{
    people: [
        {name: "Yehuda Katz", age: 22},
        {name: "Alan Johnson", age: 32},
        {name: "Charles Jolley", age: 45},
    ],
}
kumol
  • 174
  • 1
  • 9