chore: Fix random errors
This commit is contained in:
parent
03ddce0290
commit
b8f66bce0f
2 changed files with 9 additions and 10 deletions
|
@ -27,7 +27,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div formGroupName="addressGroup">
|
||||
<div formGroupName="address">
|
||||
<h5 class="mt-3">Address</h5>
|
||||
<div class="row">
|
||||
<div class="col-md-8 mb-3">
|
||||
|
@ -80,7 +80,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div formGroupName="emailGroup">
|
||||
<div formGroupName="email">
|
||||
<h5 class="mt-3">Email</h5>
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-3">
|
||||
|
@ -106,7 +106,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div formGroupName="passwordGroup">
|
||||
<div formGroupName="password">
|
||||
<h5 class="mt-3">Password</h5>
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-3">
|
||||
|
|
|
@ -6,7 +6,6 @@ import {
|
|||
Validators,
|
||||
} from '@angular/forms';
|
||||
import AuthService from '../../../service/auth.service';
|
||||
import CustomValidators from '../../../service/custom.validators';
|
||||
|
||||
@Component({
|
||||
selector: 'app-register',
|
||||
|
@ -19,8 +18,8 @@ export default class RegisterComponent {
|
|||
fb: FormBuilder = inject(FormBuilder);
|
||||
|
||||
emailGroup: FormGroup = this.fb.group({
|
||||
email: ['', Validators.required, Validators.email],
|
||||
confirmEmail: ['', Validators.required, Validators.email],
|
||||
email: ['', [Validators.required, Validators.email]],
|
||||
confirmEmail: ['', [Validators.required, Validators.email]],
|
||||
});
|
||||
|
||||
passwordGroup: FormGroup = this.fb.group({
|
||||
|
@ -39,14 +38,14 @@ export default class RegisterComponent {
|
|||
form: FormGroup = this.fb.group({
|
||||
firstname: [null, Validators.required],
|
||||
lastname: [null, Validators.required],
|
||||
password: [this.passwordGroup, CustomValidators.password()],
|
||||
email: [this.emailGroup, CustomValidators.email()],
|
||||
address: [this.addressGroup, CustomValidators.address()],
|
||||
password: this.passwordGroup,
|
||||
email: this.emailGroup,
|
||||
address: this.addressGroup,
|
||||
});
|
||||
|
||||
submit() {
|
||||
if (!this.form.valid) {
|
||||
console.log(this.form.controls);
|
||||
console.log(this.form.value);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue