Coding⏱️ 2 min read📅 2026-05-31

How to Fix: TypeScript-'s Angular Framework Error - "There is no directive with exportAs set to ngForm"

Angular Forms exportAs error fix

Quick Answer: The issue is caused by a mismatch between the Angular Forms version and the Angular version. Update the Angular Forms version to match the Angular version, or use the correct exportAs value for the directive.

The error "There is no directive with exportAs set to ngForm" occurs when the Angular Forms module is not properly configured or when there's a conflict between different modules.

🛑 Root Causes of the Error

  • The Angular Forms module is not properly imported or configured.
  • There's a conflict between different modules, such as the Angular Common module and the Angular Forms module.

🚀 How to Resolve This Issue

Method 1: Remove the exportAs Property from ngForm Directive

  1. Step 1: Open your Angular component and locate the ngForm directive.

Method 2: Update the Forms Module Configuration

  1. Step 1: Import the Angular Forms module in your component or module.

💡 Conclusion

By following these steps, you should be able to resolve the "There is no directive with exportAs set to ngForm" error in your Angular application.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions