2016-12-15 106 views
1

即使根据文档配置了firebase-app,我仍然无法获取存储参考。的火力应用内元件位于的index.html获取Firebase存储参考的问题

<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

问题是我没有在我的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">