This commit is contained in:
Kenta420-Poom 2023-09-14 10:32:30 +07:00
parent 127f086bea
commit d7b7bc7be0
3 changed files with 41 additions and 9 deletions

View file

@ -0,0 +1,41 @@
import { NgIf } from '@angular/common';
import { Component, OnInit } from '@angular/core';
import { Form, FormControl, FormGroup } from '@angular/forms';
import { RouterLink } from '@angular/router';
interface AuthForm {
email: FormControl<string>;
password: FormControl<string>;
username?: FormControl<string>;
}
@Component({
selector: 'app-auth-page',
templateUrl: './auth.component.html',
imports: [RouterLink, NgIf],
standalone: true,
})
export class AuthComponent implements OnInit {
authType = '';
title = '';
isSubmitting = false;
authForm: FormGroup<AuthForm>;
constructor(
private readonly route: ActivatedRoute,
private readonly router: Router,
private readonly userService: UserService
) {
// use FormBuilder to create a form group
this.authForm = new FormGroup<AuthForm>({
email: new FormControl('', {
validators: [Validators.required],
nonNullable: true,
}),
password: new FormControl('', {
validators: [Validators.required],
nonNullable: true,
}),
});
}
}

View file

@ -79,15 +79,6 @@
</button>
</div>
</form>
<p class="mt-10 text-center text-sm text-gray-500">
Not a member?
<a
href="#"
class="font-semibold leading-6 text-indigo-600 hover:text-indigo-500"
>Start a 14 day free trial</a
>
</p>
</div>
</div>
</main>