离子火力点发送电子邮件验证(Ionic firebase send email verification)
我试图在注册时向用户发送电子邮件验证。 用户被添加到Firebase,但不发送电子邮件。 我将错误记录到控制台,它说
无法读取未定义的属性'sendEmailVerification'
import { Component } from '@angular/core'; import { IonicPage, NavController, NavParams } from 'ionic-angular'; import { User } from "../../models/user"; import { AngularFireAuth } from "angularfire2/auth"; import * as firebase from 'firebase'; @IonicPage() @Component({ selector: 'page-register', templateUrl: 'register.html', }) export class RegisterPage { user = {} as User constructor(private afAuth: AngularFireAuth, public navCtrl: NavController, public navParams: NavParams) { } async register(user: User) { try { const result = await this.afAuth.auth.createUserWithEmailAndPassword(user.email, user.password) .then(res => { var auth = firebase.auth(); this.auth.sendEmailVerification(user.email) this.navCtrl.setRoot('LoginPage'); } } catch (e) { console.log(e); } } }
I'm trying to send an email verification to the user when they sign up. The user gets added to firebase but the email is not sent. I logged the error to the console and it says
Cannot read property 'sendEmailVerification' of undefined
import { Component } from '@angular/core'; import { IonicPage, NavController, NavParams } from 'ionic-angular'; import { User } from "../../models/user"; import { AngularFireAuth } from "angularfire2/auth"; import * as firebase from 'firebase'; @IonicPage() @Component({ selector: 'page-register', templateUrl: 'register.html', }) export class RegisterPage { user = {} as User constructor(private afAuth: AngularFireAuth, public navCtrl: NavController, public navParams: NavParams) { } async register(user: User) { try { const result = await this.afAuth.auth.createUserWithEmailAndPassword(user.email, user.password) .then(res => { var auth = firebase.auth(); this.auth.sendEmailVerification(user.email) this.navCtrl.setRoot('LoginPage'); } } catch (e) { console.log(e); } } }
原文:https://stackoverflow.com/questions/48294139
更新时间:2022-12-25 09:12
最满意答案
相关问答
更多-
Excel宏单元格地址增加(Excel macro cell address increase)[2022-05-23]
改变这个: Sheet1.Range(c.Address + 3 ) 对此 Sheet1.Range(c.Address).offset(0,3) 虽然我不知道为什么你需要Sheet1.Range(c.Address)而不仅仅是c,是ca范围? 如果是这样你就可以做c.offset(0,3) Change this: Sheet1.Range(c.Address + 3 ) To this Sheet1.Range(c.Address).offset(0,3) Although I don't kn ... -
为每5个单元格增加Excel工作表列值的值(Increase the value for Excel sheet Column value for every 5 cells)[2023-10-03]
输入以下公式:= INT((ROW(E1)-1)/ 5)+1进入要填充序号的空白单元格, 看截图: Enter this formula: =INT((ROW(E1)-1)/5)+1 into a blank cell where you want to fill the sequential numbers, see screenshot: -
使用Excel计算工作表中的单元格,值和公式的数量(Counting how many cells, values, and formulas are in a sheet with Excel)[2022-07-27]
您可以使用Range对象的SpecialCells属性来查找此信息。 例如, ActiveSheet.Cells.SpecialCells(xlCellTypeFormulas).Count将返回活动工作表上包含公式的单元格数,而ActiveSheet.Cells.SpecialCells(xlCellTypeConstants).Count将返回包含常量的单元格数。 有关更多信息,请参阅文档 。 如果您想要整个工作簿的总计,可以遍历Workbook对象的Worksheets集合的元素,使用每个Worksh ... -
VBA循环遍历单元格并从Excel工作表中的单元格中提取文件名(VBA loop throught cells and extract the file name from cells in excel sheet)[2022-03-02]
尝试这个: ' Get the sheet Dim ws As Worksheet Set ws = ThisWorkbook.Worksheets(1) ' How you will slash it Dim strSlash As String strSlash = "\" ' Set the range for your tool Dim rngFiles As Range Dim rngCell As Range Dim lngMaxRow As Long lngMaxRow = Range(" ... -
我不确定你想复制什么以及你想要粘贴到哪里,但希望这会让你开始朝着正确的方向前进: Private Sub Worksheet_Change(ByVal Target As Range) Dim rngCheck As Range Dim CheckCell As Range Dim lRow As Long Set rngCheck = Intersect(Me.Columns("T"), Target) If Not rngCheck Is Nothing T ...
-
With语句要求您限定范围/子对象,否则它们不与父级“匹配”,并且在Range或Cells等情况下,将默认为ActiveSheet : 你可以看到这个: Worksheets("Sheet2").Activate With Worksheets("Sheet1") Debug.Print Range("A1").Parent.Name '## This will print "Sheet2" Debug.Print .Range("A1").Parent.Name '## This w ...
-
这包括触发combo box的代码,你可以这样做, Private Sub ComboBox1_Change() Sheets("Sheet1").Cells(2, 5).Resize(, 5).Value = _ Sheets("Sheet2").Cells(ComboBox1.ListIndex + 2, 1).Resize(, 5).Value End Sub 但是,我不知道您希望数据在Sheet1哪个位置,因此您必须修改该范围以满足您的需求。 This includes the cod ...
-
这是因为UDF被设计为接受单个Range作为输入( 可以由多个单元组成 )。 范围仅限于单张纸上的单元格。 您需要修改UDF以处理多个范围。 That is because the UDF is designed to accept a single Range as input (which may consist of multiple cells). A Range is limited to cells on a single sheet. You need to modify the UDF to ...
-
您可以简单地遍历单元格并使用.value属性 Dim WS As Worksheet r = 0 For Each WS In ActiveWorkbook.Worksheets If Not WS.Name = "Summary" Then For I = 1 To 260 v = WS.Range("A" & I).Value If Not v = vbNullString Then r = r + 1 Wor ...
-
Excel根据另一个工作表中列表的内容清除单元格(Excel clear cells based on contents of a list in another sheet)[2022-07-23]
这是通过最小化工作表(通过范围/单元格的迭代)和代码之间的流量来使用数组的另一种方法。 此代码不使用任何clear contents 。 只需单击一个按钮,只需将整个范围放入阵列,清理并输入所需内容即可。 根据OP的要求编辑:添加注释并更改所需工作表的代码。 码: Option Explicit Sub matchAndClear() Dim ws As Worksheet Dim arrKeys As Variant, arrData As Variant Dim i As In ...