我收到此错误:
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);
});
}
}
答案 0 :(得分:0)
正确的方法是sendEmailVerification
而不是sendemailverification
答案 1 :(得分:0)
您可以使用 userData.user.sendEmailVerification()使其正常工作。