Set default email value programmatically in appeal form and remove inline default logic.
This commit is contained in:
parent
c75f0cdb15
commit
cad574b8fb
|
|
@ -81,8 +81,7 @@
|
|||
<mat-label>Email</mat-label>
|
||||
<input matInput
|
||||
formControlName="email"
|
||||
placeholder="Email"
|
||||
[defaultValue]="verifiedEmails().length > 0 ? verifiedEmails()[0] : ''">
|
||||
placeholder="Email">
|
||||
@if (form.controls.email.invalid && form.controls.email.touched) {
|
||||
<mat-error>
|
||||
@if (form.controls.email.errors?.['required']) {
|
||||
|
|
|
|||
|
|
@ -79,7 +79,12 @@ export class AppealComponent implements OnInit, OnDestroy, AfterViewInit {
|
|||
this.emailIsValid.set(false);
|
||||
}
|
||||
});
|
||||
|
||||
computed(() => {
|
||||
if (this.verifiedEmails().length > 0) {
|
||||
this.form.get('email')?.setValue(this.verifiedEmails()[0]);
|
||||
this.emailIsValid.set(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user