即使我根据文档配置了firebase-app,我也无法获取存储引用。 firebase-app元素位于index.html
中<firebase-app name="name-of-the-app"
api-key="api_key"
auth-domain="name-of-the-app.firebaseapp.com"
database-url="https://name-of-the-app.firebaseio.com"
storage-bucket="name-of-the-app.appspot.com">
</firebase-app>
我通过以下方式访问子视图中的应用参考:
<firebase-document id="office_document"
app-name="doctor-appointment-system"
path="/offices">
</firebase-document>
<script>
this.$.office_document.app.storage()
</script>
上面的代码抛出错误。
这个。$。office_document.storage不是一个函数
数据库对应工作正常。
this.$.office_document.app.database()
答案 0 :(得分:0)
问题是我的index.html中没有导入firebase存储脚本,其中应用程序是使用firebase-app元素初始化的。
以下是我的导入现在的样子:
<link rel="import" href="/bower_components/polymerfire/firebase-app.html">
<link rel="import" href="/bower_components/polymerfire/firebase-storage-script.html">
<link rel="import" href="/bower_components/polymerfire/firebase-document.html">