Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
147 views
in Technique[技术] by (71.8m points)

polymer - Polymerfire firebase-query not working and no error log

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

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

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...