【问题标题】:error TS2339: Property 'sendemailverification' does not exist on type 'UserCredential'错误 TS2339:“UserCredential”类型上不存在属性“sendemailverification”
【发布时间】:2019-06-02 16:10:58
【问题描述】:

我收到此错误:

error TS2339: Property 'sendemailverification' does not exist on type 'UserCredential'

这是我的代码 我使用firebase电子邮件验证

import { Component, OnInit } from '@angular/core';
import {NgForm} from '@angular/forms';
import * as firebase from 'firebase/app';

@Component({
  selector: 'app-sign-up',
  templateUrl: './sign-up.component.html',
 styleUrls: ['./sign-up.component.css']
})
export class SignUpComponent implements OnInit {

  constructor() { }

  ngOnInit() {
}

onSubmit(form: NgForm) {
const fullname = form.value.fullname;
const email = form.value.email;
const password = form.value.password;

firebase.auth().createUserWithEmailAndPassword(email, password)
  .then(userData => {
    //error
    userData.sendemailverification();
    console.log(userData);
  })
  .catch(err =>{
    console.log(err);
  });
  }

}

【问题讨论】:

    标签: typescript angular-cli-v6


    【解决方案1】:

    您可以使用userData.user.sendEmailVerification() 使其工作。

    【讨论】:

      【解决方案2】:

      正确的方法是sendEmailVerification不是sendemailverification

      【讨论】:

        猜你喜欢
        • 2020-12-01
        • 2019-01-21
        • 2016-08-13
        • 2017-12-20
        • 2016-11-14
        • 2017-10-24
        • 2021-08-10
        • 2018-11-17
        • 2020-09-25
        相关资源
        最近更新 更多