类型错误:jit_nodeValue_17(...) 不是函数

mr.*_*nza 3 typescript angular-material angular

这里的主要目的是注册用户,起初它工作正常,但现在我做了一些更改,在单击按钮时输入电子邮件和密码后,它会出现此错误: 请在此处查看错误,在此处 输入图片描述


身份验证服务:

utilizadorCadastrar(value) {
return new Promise<any> ((resolve, reject) => {
  return this.afAuth.auth.createUserWithEmailAndPassword(value.email, value.senha)
  .then(res => {
    resolve(res);
  }, err  => reject(err));
});
Run Code Online (Sandbox Code Playgroud)

}


cliente-cadadstrar.component.ts:

export class ClienteRegistrarComponent implements OnInit {

formCadastro: FormGroup;

{...}

ngOnInit() {
   this.iniciarForm();
}

public cadastrar(value) {
   this.auth.utilizadorCadastrar(value)
    .then(res => {
        console.log(res);
    }, err => {
         console.log(err);
    });  }
    { ... }
Run Code Online (Sandbox Code Playgroud)

客户端注册器.component.html

错误来自按钮(单击)“事件”上的这里

 <form class="form-normal" [formGroup]="formCadastro">
<div class="entrar-container">
  <h1 matDialogTitle>Cadastrar-se</h1>
  <mat-dialog-content class="entrar-container">
    <mat-form-field class="input-full-width" color="warn">
      <input type="email" matInput id="email" placeholder="Email" name="email" formControlName="email">
      <mat-error *ngIf="errosForm.email">
        {{errosForm.email}}
      </mat-error>
    </mat-form-field>
    <mat-form-field class="input-full-width" color="warn">
      <input type="password" matInput id="senha" placeholder="Senha" name="senha" formControlName="senha" [type]="hide ? 'password' : 'text'">
      <mat-icon matSuffix (click)="hide = !hide">{{hide ? 'visibility_off' : 'visibility'}}</mat-icon>
      <mat-error *ngIf="errosForm.senha">
        {{errosForm.senha}}  
      </mat-error>
    </mat-form-field>
  </mat-dialog-content>
  <mat-dialog-actions align="end">
    <button type="submit" mat-raised-button color="warn" [disabled]="!formCadastro.valid" (click)="cadastrar(formCadastro.value)">Cadastrar-se</button>
  </mat-dialog-actions>
</div>
Run Code Online (Sandbox Code Playgroud)

mar*_*elc 7

我今天收到了同样的错误,当我的按钮点击与表单上的另一个元素同名时。当我重命名它时,错误消失了。