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)
}
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)
错误来自按钮(单击)“事件”上的这里
<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)
| 归档时间: |
|
| 查看次数: |
909 次 |
| 最近记录: |