I am getting error No directive found with export as ngForm
My app.module.ts
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { CommonModule } from '@angular/common';
My imports
imports: [ReactiveFormsModule,CommonModule,FormsModule]
LoginComponent.html
<div class="row w-100 mx-0">
<div class="col-lg-4 mx-auto">
<div class="auth-form-light text-left py-5 px-4 px-sm-5">
<div class="brand-logo">
<img src="assets/images/logo.png" alt="logo">
</div>
<form class="pt-3" #f="ngForm" (ngSubmit)="onSubmit(f)" >
<div class="form-group">
<input type="email" class="form-control form-control-lg" id="userId" name="userId" placeholder="LogIn ID" ngModel>
</div>
<div class="form-group">
<input type="password" class="form-control form-control-lg" id="userName" name="userPassword" placeholder="Password" ngModel>
</div>
<div class="mt-3">
<button type="submit" class="btn btn-gradient-light btn-rounded btn-fw btn-lg" routerLink="/dashboard">Log In</button>
</div>
</form>
</div>
</div>
</div>
</div>
LoginComponent.ts ngForm are imported but i am getting the error that import is required formsModule and NgForm are imported and i am getting the error at npm start
import{NgForm} from '@angular/forms';
import { FormsModule } from '@angular/forms';
arr: any[]=[];
onSubmit(form : NgForm) {
this.arr = form.value
console.log(JSON.stringify(this.arr))
}