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