I have problem similar to this, except that I'm using polymer template from this.
I imported all polymerfire references both in the page where <firebase-app>
is declared and in the page where <firebase-query>
is used. Not working.
I found later that the template uses polymerfire which version is v0.9.4 instead of the latest v0.10.3. I tried uninstalling and re-installing the new version. Nothing changed.
For additional information, here's a snippet of the code:
src/app-auth/app-auth-firebase.html
<link rel="import" href="../../bower_components/polymerfire/polymerfire.html">
<link rel="import" href="../../bower_components/polymerfire/firebase-app.html">
<link rel="import" href="../../bower_components/polymerfire/firebase-auth.html">
<link rel="import" href="../../bower_components/polymerfire/firebase-query.html">
...
<firebase-app name="pwa-demo" api-key="abc" auth-domain="abc" database-url="abc"></firebase-app>
<firebase-auth id="auth" app-name="pwa-demo" signed-in="{{_signedIn}}" user="{{_user}}"on-error="_onAuthError"></firebase-auth>
src/app-pages/app-page-new-stuff/app-page-new-stuff.html
<link rel="import" href="../../../bower_components/polymerfire/firebase-auth.html">
<link rel="import" href="../../../bower_components/polymerfire/firebase-query.html">
<link rel="import" href="../../../bower_components/polymerfire/polymerfire.html">
...
<firebase-auth user="{{user}}"></firebase-auth>
<firebase-query id="stuffquery" app-name="pwa-demo" path="/users/[[user.uid]]/events" data="{{events}}"> </firebase-query>
...
_onFormSubmit: function() {
this.$.stuffquery.ref.push({
title: this.$.piTitle.value
});
}
Is there anything else that I'm missing? Please help.
EDIT:
I found two other weird things, which might be helpful. First, I couldn't do both retrieving the data and pushing the data from and to my app. Second, when I attempt to run firebase.database()
in browser console, I got "Firebase: No Firebase App '[DEFAULT]' has been created - call Firebase App.initializeApp() (app/no-app)."
Anyone?