I was able to retrieve back the data but they were formatted as bunch of Objects instead of 1 Array. So here is my code:
team-list.html
<dom-module id="team-list">
<template>
<firebase-document
id="query"
app-name="appname"
path="/teams/"
data="{{teamDatas}}">
</firebase-document>
<template
is="dom-repeat"
items="{{teamDatas}}"
as="teamData">
<team-item teamData="{{teamData}}"></team-item>
</template>
</template>
<script>
Polymer({
is: 'team-list',
properties:{
teamDatas: Array,
}
});
</script>
</dom-module>
team-item.html
<dom-module id="team-item">
<template>
<p> {{teamData.teamTag}}</p>
</template>
<script>
Polymer({
is: 'team-item',
properties: {
teamData: Object,
}
});
</script>
</dom-module>
{{teamDatas}} return as 4 Objects instead of 1 Arrays
Expected array for items
, found Object {-KPZg55u6YQg3EoywQCV: Object, -KPZg7XEsXbhCc854ZEQ: Object, -KPZg8no-OMP-PVIdcj9: Object, -KPZgq-0ql_ihuEcEnSV: Object}
My Json is as follow:
{
"teams" : {
"-KPZg55u6YQg3EoywQCV" : {
"leader" : "iU1RPyyjAzPfqnes4PdEpGQLaaH3",
"teamName" : "dsazxc",
"teamTag" : "zxc"
},
"-KPZg7XEsXbhCc854ZEQ" : {
},
"-KPZg8no-OMP-PVIdcj9" : {
},
"-KPZgq-0ql_ihuEcEnSV" : {
}
}
What wrong with my code?