Skip to main content

Posts

Showing posts with the label Reactive forms in angular 17

No directive found with exportAs 'ngForm'.ngtsc(-998003)

 At the time of Reactive Forms Validate, I got this error: No directive found with exportAs 'ngForm'.ngtsc(-998003) After that, I added to ReactiveFormsModule in the imports[] array to resolve this error. import { CommonModule } from '@angular/common'; import { NgForm,FormsModule, ReactiveFormsModule } from '@angular/forms'; In Component class, imports: [RouterOutlet, FormsModule, ReactiveFormsModule, CommonModule] Example, import { CommonModule } from '@angular/common'; import { Component } from '@angular/core'; import { NgForm,FormsModule, ReactiveFormsModule } from '@angular/forms'; import { RouterOutlet } from '@angular/router'; @Component({   selector: 'app-root',   standalone: true,   imports: [RouterOutlet,FormsModule,ReactiveFormsModule,CommonModule],   templateUrl: './app.component.html',   styleUrl: './app.component.css' }) export class AppComponent {   title = 'Form Validation';   form = ...