1

我有 db-module,它是负责处理数据的元素。然后我在我的加入模块中创建了这个元素。但是当我尝试访问 db-module 方法join(email,password)时,它说它不是一个函数

数据库模块:

   <template>
    <firebase-app 
        auth-domain="campus-3320b.firebaseapp.com"
        database-url="https://campus-3320b.firebaseio.com"
        api-key="AIzaSyBVpKa8SmWPKl595AZ8BmCMVBOkmZ6Lft0"
        storageBucket="campus-3320b.appspot.com">
    </firebase-app>
    <firebase-auth 
        id="auth" 
    >
    </firebase-auth>
</template>

 Polymer({
      is: 'data-module',
      join: function(email,password){
          console.log('join')
        this.$.auth.signInWithEmailAndPassword(email,password);
      },
      login: function(email,password){
          this.$.auth.createUserWithEmailAndPassword(email, password);
      }
});

加入模块:

<db-module id="auth"></db-module>



 Polymer({
  is: 'join-module',
  name: String,
  surname: String,
  email: String,
  password1: String,
  join: function(){
      this.$.auth.join(this.email,this.password)
  } 
});
4

0 回答 0