Avatar ·

Angular Error: "There is no directive with exportAs set to ngForm" when working with forms

Hello everyone! I'm new to Angular and TypeScript, and I've been struggling for hours with an error that occurs when trying to use template-driven forms. I have a simple component for user registration. I created a form with two fields: email and password. I'm using the `ngModel` directive for two-way data binding and want to access the form through a local variable `#myForm="ngForm"`. Here's my code: **user-registration.component.ts:** ```typescript import { Component } from '@angular/core'; @Component({ selector: 'app-user-registration', templateUrl: './user-registration.component.html', styleUrls: ['./user-registration.component.css'] }) export class UserRegistrationComponent { user = { email: '', password: '' }; onSubmit() { consol