Angularjs 财产';发送电子邮件验证&x27;不存在于类型';承诺<;用户>';。ts(2339)
我有一个错误:Angularjs 财产';发送电子邮件验证&x27;不存在于类型';承诺<;用户>';。ts(2339),angularjs,firebase,firebase-authentication,Angularjs,Firebase,Firebase Authentication,我有一个错误: Property 'sendEmailVerification' does not exist on type 'Promise<User>'.ts(2339) 我不知道错误的来源以及我遗漏了什么?您需要等待承诺解决: SendVerificationMail() { return this.afAuth.currentUser.then((user) => { return user.sendEmailVerification();
Property 'sendEmailVerification' does not exist on type 'Promise<User>'.ts(2339)
我不知道错误的来源以及我遗漏了什么?您需要等待承诺解决:
SendVerificationMail() {
return this.afAuth.currentUser.then((user) => {
return user.sendEmailVerification();
}).then(() => {
this.router.navigate(['verify-email-address']);
})
}
它看起来像是
this.afAuth.currentUser
是一个承诺,而不是用户对象。您必须使用wait或then来访问用户。
SendVerificationMail() {
return this.afAuth.currentUser.then((user) => {
return user.sendEmailVerification();
}).then(() => {
this.router.navigate(['verify-email-address']);
})
}