Mid
From PDF
Angular
Angular
Bind the form in template using formGroup and formControlName.?
✅ Example:
this.profileForm = new FormGroup({
firstName: new FormControl('', Validators.required),
lastName: new FormControl(''),
email: new FormControl('', [Validators.required,
Validators.email])
});
<form [formGroup]="profileForm" (ngSubmit)="onSubmit()">
<input formControlName="firstName" />
<input formControlName="lastName" />
<input formControlName="email" />
<button type="submit">Submit</button>
</form>
Share this Q&A
Share preview image: https://www.toolliyo.com/images/toolliyo-logo.png