Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I want to fetch data from Firebase using polymerfire and somehow it doesn't work.

Firebase data

lol-project (a name with 5 randomized letters)
+- events
    +- (some random event id, which is auto-generated)
        +- name: "haha"
        +- desc: "hihi"
    +- (some random event id, which is auto-generated)
        +- name: "huhu"
        +- desc: "hehe"

Code (Polymer v1.6, Polymerfire v0.10.2)

<link rel="import" href="../../../bower_components/polymerfire/polymerfire.html">
<link rel="import" href="../../../bower_components/polymerfire/firebase-auth.html">
<link rel="import" href="../../../bower_components/polymerfire/firebase-query.html">
...
<firebase-auth user="{{user}}"></firebase-auth>

<firebase-query id="eventquery" path="/events" data="{{events}}"></firebase-query>

<div class="Page-container" id="section1">
    <template is="dom-repeat" items="[[events]]" as="item">
        <p>[[item.name]]</p>
    </template>
</div>
...
properties: {
    events: {
        type: Object,
        observer: '_eventsChanged'
    }
},

_eventsChanged: function(newData, oldData) {
    console.log("it changed?!");
    console.info(newData);
}

Firebase rules

{
  "rules": {
    ".read": "auth != null",
    ".write": "auth != null"
  }
}

No error, no data. The console.info(newData); gives empty array. After hours of googling, I stumbled upon similar case, which apparently left unanswered in here (yes, this problem is pretty much similar to that one).

Anyone knows what I'm missing? Please help.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
144 views
Welcome To Ask or Share your Answers For Others

1 Answer

Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...