【发布时间】:2020-12-01 00:14:51
【问题描述】:
所以我正在开发我的 ionic4 应用程序,我在 sendEmailVerification 函数上遇到错误。控制台询问我是否忘记使用“等待”。有什么解决办法?谢谢。
import { Injectable } from '@angular/core';
import { AngularFireAuth } from '@angular/fire/auth';
@Injectable({
providedIn: 'root'
})
export class FirebaseAuthService {
constructor(private angularFireAuth: AngularFireAuth) { }
async registerWithEmailPassword(email, password) {
try {
const result = await this.angularFireAuth.createUserWithEmailAndPassword(email, password);
await this.angularFireAuth.currentUser.sendEmailVerification();
return result;
}catch (error) {
throw new Error(error);
}
}
}
【问题讨论】:
标签: angular typescript ionic-framework firebase-authentication angularfire2