<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>nullinjectorerror: no provider for ngform! - TheCodeBuzz</title>
	<atom:link href="https://thecodebuzz.com/tag/nullinjectorerror-no-provider-for-ngform/feed/" rel="self" type="application/rss+xml" />
	<link>https://thecodebuzz.com</link>
	<description>Best Practices for Software Development</description>
	<lastBuildDate>Fri, 24 Nov 2023 23:39:14 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://thecodebuzz.com/wp-content/uploads/2022/11/cropped-android-chrome-512x512-1-1-51x51.jpg</url>
	<title>nullinjectorerror: no provider for ngform! - TheCodeBuzz</title>
	<link>https://thecodebuzz.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>There is no directive with exportAs set to ngForm</title>
		<link>https://thecodebuzz.com/there-is-no-directive-with-exportas-set-to-ngform/</link>
					<comments>https://thecodebuzz.com/there-is-no-directive-with-exportas-set-to-ngform/#comments</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Mon, 01 Mar 2021 01:12:00 +0000</pubDate>
				<category><![CDATA[Angular]]></category>
		<category><![CDATA[Tips and Guidelines]]></category>
		<category><![CDATA[error ng8003: no directive found with exportas 'ngform'.]]></category>
		<category><![CDATA[error: export of name 'ngform' not found!]]></category>
		<category><![CDATA[export of name 'ngform' not found!]]></category>
		<category><![CDATA[no directive found with exportas 'ngform']]></category>
		<category><![CDATA[no directive found with exportas 'ngform' angular 9 there is no directive with "exportas" set to "ngform" ("]]></category>
		<category><![CDATA[no provider for ngform]]></category>
		<category><![CDATA[nullinjectorerror: no provider for ngform!]]></category>
		<category><![CDATA[template parse errors: there is no directive with "exportas" set to "ngform"]]></category>
		<category><![CDATA[there is no directive with "exportas" set to "ngform" angular]]></category>
		<category><![CDATA[There is no directive with “exportAs” set to “ngForm”]]></category>
		<category><![CDATA[there is no directive with exportas set to ngform jasmine]]></category>
		<category><![CDATA[there is no directive with exportas set to ngform karma]]></category>
		<guid isPermaLink="false">https://thecodebuzz.com/?p=6052</guid>

					<description><![CDATA[<p>There is no directive with &#8220;exportAs&#8221; set to &#8220;ngForm&#8221; Today in this article, we will see how to fix error &#8220;There is no directive with exportAs set to ngForm&#8221; Issue Description: The angular app shows the below error in the browser, There is no directive with "exportAs" set to "ngForm" Resolution: Please register FormsModule or [&#8230;]</p>
<p>The post <a href="https://thecodebuzz.com/there-is-no-directive-with-exportas-set-to-ngform/">There is no directive with exportAs set to ngForm</a> first appeared on <a href="https://thecodebuzz.com">TheCodeBuzz</a>.</p>]]></description>
										<content:encoded><![CDATA[<h1 class="wp-block-heading">There is no directive with &#8220;exportAs&#8221; set to &#8220;ngForm&#8221;</h1>



<p>Today in this article, we will see how to fix error &#8220;There is no directive with exportAs set to ngForm&#8221;</p>



<p></p>



<div class="wp-block-aioseo-table-of-contents"><ul><li><a href="#aioseo-issue-description">Issue Description:</a></li><li><a href="#aioseo-resolution">Resolution:</a></li><li><a href="#aioseo-test-project-update">Fix &#8211; Test Project Configuration</a></li></ul></div>



<p></p>



<h2 class="wp-block-heading" id="aioseo-issue-description">Issue Description:</h2>



<p></p>



<p>The angular app shows the below error in the browser,</p>



<p></p>



<pre class="wp-block-preformatted has-vivid-red-color has-very-light-gray-background-color has-text-color has-background">There is no directive with "exportAs" set to "ngForm"</pre>



<figure class="wp-block-image"><a href="https://www.thecodebuzz.com/there-is-no-directive-with-exportas-set-to-ngform/" target="_blank" rel="noopener"><img fetchpriority="high" decoding="async" width="1147" height="148" src="https://i0.wp.com/thecodebuzz.com/wp-content/uploads/2019/10/image-9.png?fit=785%2C101&amp;ssl=1" alt="There is no directive with &quot;exportAs&quot; set to &quot;ngForm&quot;" class="wp-image-6057" srcset="https://thecodebuzz.com/wp-content/uploads/2019/10/image-9.png 1147w, https://thecodebuzz.com/wp-content/uploads/2019/10/image-9-300x39.png 300w, https://thecodebuzz.com/wp-content/uploads/2019/10/image-9-1024x132.png 1024w, https://thecodebuzz.com/wp-content/uploads/2019/10/image-9-768x99.png 768w, https://thecodebuzz.com/wp-content/uploads/2019/10/image-9-785x101.png 785w" sizes="(max-width: 1147px) 100vw, 1147px" /></a></figure>



<p></p>



<h2 class="wp-block-heading" id="aioseo-resolution">Resolution:</h2>



<p></p>



<p>Please register <strong><em>FormsModule</em></strong> or <em><strong>ReactiveFormsModule</strong></em> in <strong><em>NgModule</em></strong>.</p>



<p></p>



<p>In app.module.ts, please add the below import statement,</p>



<p></p>



<pre class="wp-block-preformatted has-medium-font-size"> import { FormsModule } from '@angular/forms' 

 import { ReactiveFormsModule} from '@angular/forms' </pre>



<p></p>



<p>Also please update the import section as below,</p>



<p></p>



<pre class="wp-block-code"><code>imports: &#91;
    BrowserModule,
    HttpClientModule,
    ReactiveFormsModule,
    FormsModule      
  ],</code></pre>



<p></p>



<p>Please add &#8216;FormsModule&#8217;/ReactiveFormsModule&#8217; in imports section of NgModule</p>



<p></p>



<p>Sample app.module.ts as below,</p>



<p></p>



<pre class="wp-block-code"><code>import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms'
import { ReactiveFormsModule } from '@angular/forms';
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { UserSettingsFormComponent } from './user-settings-form/user-settings-form.component';
@NgModule({
  declarations: &#91;
    AppComponent,
    UserSettingsFormComponent
  ],
  imports: &#91;
    BrowserModule,
    HttpClientModule,
    FormsModule,    
    ReactiveFormsModule
  ],
  providers: &#91;],
  bootstrap: &#91;AppComponent]
})
export class AppModule { }</code></pre>



<p></p>



<h2 class="wp-block-heading" id="aioseo-test-project-update">Fix &#8211; Test Project Configuration </h2>



<p></p>



<p>You might see a similar error while writing unit test cases in the Spec file too. </p>



<p></p>



<p>If you come across any issue kindly perform the similar above steps to fix the issue.</p>



<p></p>



<p></p>



<p>That&#8217;s all! Happy coding!</p>



<p></p>



<p>Does this help you fix your issue? </p>



<p></p>



<p>Do you have any better solutions or suggestions? Please sound off your comments below.</p>



<p></p>



<hr>



<p class=""></p>



<p class="has-background" style="background-color:#b6d9ac;font-size:18px"><br>Please <strong><em>bookmark </em></strong>this page and <em><strong>share </strong></em>it with your friends.                                                    Please <a href="https://www.thecodebuzz.com/subscription/" target="_blank" rel="noreferrer noopener"><em><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-luminous-vivid-orange-color"><strong>Subscribe</strong> </mark></em></a>to the blog to receive notifications on freshly published (2025) best practices and guidelines for software design and development.</p>




<br>



<hr>



<p class=""></p><p>The post <a href="https://thecodebuzz.com/there-is-no-directive-with-exportas-set-to-ngform/">There is no directive with exportAs set to ngForm</a> first appeared on <a href="https://thecodebuzz.com">TheCodeBuzz</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://thecodebuzz.com/there-is-no-directive-with-exportas-set-to-ngform/feed/</wfw:commentRss>
			<slash:comments>9</slash:comments>
		
		
			</item>
	</channel>
</rss>
