Iterating over an array myarray=[1, 2, 3]
works like this:
[[item]]<
You need to turn this object into a meaningful array to be able to iterate over it with the dom-repeat
.
I have created a myObj
property with the initial value. I have then created a property called myObjAsArray
which is an empty array. In the ready
callback function which is called when the local dom is ready, I am iterating over all of the properties of myObj
and adding them to myObjAsArray
(see here for how to iterate through an objects properties). You can then iterate over this array with dom-repeat
.
name: {{item.name}}
value: {{item.value}}