Closed malikolabiyi closed 3 years ago
I have this list:
const list = [{"name":"Elon Musk","company":"Tesla"},{"name":"Bill Gate","company":"Microsoft"}]
I want to loop each of them and get their names and the company's value.
I have tried this, but it didn't work:
`{{#each list}} {{#each this}}
{{name}}
<p>{{company}}</p>
{{/each}} {{/each}} `
seems like a question for handlebars this project just adds handlebars to the express view engine.
handlebars
You should try:
{{#each list}} <p>{{name}}</p> <p>{{company}}</p> {{/each}}
I have this list:
const list = [{"name":"Elon Musk","company":"Tesla"},{"name":"Bill Gate","company":"Microsoft"}]
I want to loop each of them and get their names and the company's value.
I have tried this, but it didn't work:
`{{#each list}} {{#each this}}
{{name}}
{{/each}} {{/each}} `