【发布时间】:2017-04-01 08:08:46
【问题描述】:
我有类似this 的问题,除了我使用来自this 的聚合物模板。
我在声明<firebase-app> 的页面和使用<firebase-query> 的页面中导入了所有的polymerfire 引用。不工作。
后来我发现模板使用的是版本为 v0.9.4 的 Polymerfire,而不是最新的 v0.10.3。我尝试卸载并重新安装新版本。没有任何改变。
更多信息,这里是代码的sn-p:
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
});
}
我还有什么遗漏的吗?请帮忙。
编辑:
我发现了另外两件奇怪的事情,这可能会有所帮助。首先,我不能既检索数据又将数据从我的应用程序推送到我的应用程序。其次,当我尝试在浏览器控制台中运行firebase.database() 时,我得到了"Firebase: No Firebase App '[DEFAULT]' has been created - call Firebase App.initializeApp() (app/no-app)."
有人吗?
【问题讨论】:
标签: firebase polymer polymerfire firebase-polymer