I have this code:
import { RegisterComponent } from './register.component';
import { Component, OnInit } from '@angular/core';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { Router } from '@angular/router';
import { AuthService } from '../../../../src/app/services/auth.service';
import { User } from '../../../Models/User';
@Component({
selector: 'app-register',
templateUrl: './register.component',
})
export class RegisterComponent implements OnInit {
repeatpass: string = 'none';
constructor(private authService: AuthService,
private router: Router) { }
ngOnInit(): void {
}
goToMenu() {
this.router.navigate(['componenets/food-menu']);
}
registerForm = new FormGroup({
firstname: new FormControl("",[Validators.required,Validators.minLength(2), Validators.pattern("[a-zA-Z].*")]),
lastname: new FormControl("",[Validators.required,Validators.minLength(2), Validators.pattern("[a-zA-Z].*")]),
email: new FormControl("", [Validators.required,Validators.email]),
mobile: new FormControl("", [Validators.required,Validators.pattern("[0-9]*"),Validators.minLength(10),Validators.maxLength(10),]),
gender: new FormControl("", [Validators.required]),
pwd: new FormControl("", [Validators.required,Validators.minLength(6),Validators.maxLength(15)]),
rpwd: new FormControl(""),
});
registerSubmited() {
{
this.repeatpass = 'none'
let modal: User = {} as User;
this.authService.registerUser(modal);
}
}
get FirstName(): FormControl {
return this.registerForm.get("firstname") as FormControl;
}
get LastName(): FormControl {
return this.registerForm.get("lastname") as FormControl;
}
get Email(): FormControl {
return this.registerForm.get("email") as FormControl;
}
get Mobile(): FormControl {
return this.registerForm.get("mobile") as FormControl;
}
get Gender(): FormControl {
return this.registerForm.get("gender") as FormControl;
}
get PWD(): FormControl {
return this.registerForm.get("pwd") as FormControl;
}
}
I am getting Individual declarations in merged declaration 'RegisterComponent' must be all exported or all local.ts(2395) ?