Files
micro-frontend/accounting-ng-nuttakit/src/app/component/login-register/login-register.component.ts
x2Skyz 809e2e16bb
All checks were successful
Build Docker Image / Build Docker Image (push) Successful in 6m18s
-commit
2025-11-23 12:23:28 +07:00

47 lines
1.6 KiB
TypeScript

import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
import { GeneralService } from '../../services/generalservice';
@Component({
selector: 'app-login-register',
standalone: false,
templateUrl: './login-register.component.html',
styleUrl: './login-register.component.css',
})
export class LoginRegisterComponent implements OnInit {
@Output() registeredEventSubmit = new EventEmitter<any>();
registerFrm!: FormGroup;
currentStep = 1;
constructor(){}
ngOnInit(): void {
this.setupFormControl();
}
setupFormControl(): void {
this.registerFrm = new FormGroup({
username: new FormControl('',[Validators.required, Validators.maxLength(100)]),
userlastname: new FormControl('',[Validators.required, Validators.maxLength(100)]),
email: new FormControl('',[Validators.required, Validators.email, Validators.maxLength(100)]),
password: new FormControl('',[Validators.required, Validators.maxLength(50)]),
confirmPassword: new FormControl('',[Validators.required, Validators.maxLength(50)]),
terms: new FormControl(false, [Validators.requiredTrue])
});
}
onSubmit(){
let data = {
username: this.registerFrm.get('username')?.value,
userlastname: this.registerFrm.get('userlastname')?.value,
email: this.registerFrm.get('email')?.value,
password: this.registerFrm.get('password')?.value
}
this.RegisteredEventSubmit(data);
}
RegisteredEventSubmit(event: any){
this.registeredEventSubmit.emit(event);
}
}