Skip to content
Related Articles

Related Articles

Save Article
Improve Article
Save Article
Like Article

Angular FormsModule Directive

  • Last Updated : 04 Jun, 2021

In this article, we are going to see what is FormsModule in Angular 10 and how to use it.

The FormsModule is used to make all the necessary imports for form implementation.


import { FormsModule } from '@angular/forms';


  • Create an Angular app to be used.
  • In app.component.ts import forms from FormsModules.
  • In app.component.html, make a form using FormsModule.
  • Serve the angular app using ng serve to see the output.


Example 1:


import { NgModule } from '@angular/core';
// Importing forms module
import { FormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from 
import { AppComponent }   from './app.component';
  bootstrap: [
  declarations: [
  imports: [
export class AppModule { }


<form #gfgform = "ngForm">
  {{ gfgform.value | json }}
  Name: <input type="text" name = 'name' ngModel>
  Roll: <input type="text" name = 'roll' ngModel>



My Personal Notes arrow_drop_up
Recommended Articles
Page :