Display an array of objects in HTML page


My code :

contents() {
var contentArray = [];
var content1 =
‘contentName’: ‘test1’,
‘contentSize’: ‘test1’,
‘contentType’: ‘test1’,
var content2 =
‘contentName’: ‘test2’,
‘contentSize’: ‘test2’,
‘contentType’: ‘test2’,
return contentArray;

How can I display my “contents” in HTML page ?

{{#each contents}}


This doesn’t work for me :frowning:


Try this:

{{#each contents}}


I try it ! Doesn’t work …


@jhuenges is correct. But so are you :wink:. Either of those forms will work, as will this:

<template name="home">
  {{#each content in contents}}

So, I wonder if you have got a template “home” and if you have invoked it ({{> home}})?


It is working now ! I thought the problem is from this code or I missed something :frowning: But it’s okay now :wink: thank you