31 lines
853 B
TypeScript
31 lines
853 B
TypeScript
import { Component, inject } from "@angular/core";
|
|
import { FormControl, FormGroup, ReactiveFormsModule } from "@angular/forms";
|
|
import { AuthService } from "../../services/auth-service";
|
|
import { RegisterUserRequest } from "../../../../core/models/user.model";
|
|
|
|
@Component({
|
|
selector: "app-register",
|
|
imports: [ReactiveFormsModule],
|
|
templateUrl: "./register.html",
|
|
styleUrl: "./register.css",
|
|
})
|
|
export class Register {
|
|
|
|
authService = inject(AuthService);
|
|
|
|
registerForm = new FormGroup({
|
|
name :new FormControl(''),
|
|
email :new FormControl(''),
|
|
mobile_number : new FormControl(''),
|
|
password : new FormControl(''),
|
|
password_confirmation : new FormControl(''),
|
|
city : new FormControl(''),
|
|
});
|
|
|
|
registerUser() {
|
|
this.authService.register(this.registerForm.value as RegisterUserRequest)
|
|
.subscribe();
|
|
}
|
|
|
|
}
|