I am using dom-repeat
in Polymer for repeating an Array loaded from Firebase and I cannot figure out, why I get the "expected array for items, found Object" error as shown in the screenshot below. Here is the code I am using:
<data-firebase data="{{cardsetList}}" requested-location="card-sets" user="{{user}}"></data-firebase>
<template is="dom-repeat" items="[[cardsetList]]">
<paper-card image="../images/trip.png" alt="Donuts" class="amber" >
<div class="card-content">Test {{index}}</div>
</paper-card>
</template>
Browser view & console
data-firebase is an element I have created that loads the data from FB, as you can see in the console with success (the array of 2 objects is what I want to load
Empty array before loading I checked if there is some not array data in the object I have before loading, but as you can also see in the console it is just an empty array. If I stop loading data from Firebase, there is also no error
Meaningful array in Firebase I also checked the data in FB, it is represented as a JSON array (I can see that when I export the data, the data is exported in the array brackets [])
Problem: Data gets loaded but the error persists How can it be that the dom repeat takes place (as you can see it is rendered) and also in the console there is an Array, but I am getting this error still?
Thanks a lot!
Kind regards, Tim
My understanding is that there is no support for arrays in firebase and that arrays get stored as "object" with integers as the key names.
See here:
https://firebase.googleblog.com/2014/04/best-practices-arrays-in-firebase.html
That looks to be just what you are getting back.