【发布时间】:2020-11-30 12:09:17
【问题描述】:
所以我正在开发我的 ionic4 应用程序,但在 try-catch 块中的 auth 上出现错误。我尝试安装 firebase 包并添加 auth 导入,但似乎没有任何效果。可能是什么问题?
import { Injectable } from '@angular/core';
import { AngularFireAuth } from '@angular/fire/auth';
import { Auth } from 'firebase';
@Injectable({
providedIn: 'root'
})
export class FirebaseAuthService {
auth: any[];
constructor(private angularFireAuth: AngularFireAuth) { }
async registerWithEmailPassword(email, password) {
try {
const result = await this.angularFireAuth.auth.createUserWithEmailAndPassword(email, password);
await this.angularFireAuth.auth.currentUser.sendEmailVerification();
return result;
} catch (error) {
throw new Error(error);
}
}
}
【问题讨论】:
标签: angular typescript ionic-framework firebase-authentication angularfire2