import { Component } from '@angular/core'; import { FormBuilder, FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; @Component({ selector: 'app-root', standalone: true, imports: [ReactiveFormsModule], templateUrl: './app.component.html', styleUrl: './app.component.css' }) export class AppComponent { employeeForm !: FormGroup; constructor(private formBuilder: FormBuilder) {} ngOnInit() { this.employeeForm = this.formBuilder.group({ name: new FormControl(''), city: new FormControl(''), salary: new FormControl('') }) } onSubmit() { console.log(this.employeeForm.value); } }