Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

How to get the value of the form in Angular ?

  • Last Updated : 24 May, 2021

In this article, we are going to see how to get value from the form in Angular 10. We will use AbstractControl value property to get the form value in an object.



Return Value:

  • object: It is an object containing form value


  • Create the Angular app to be used
  • In app.component.html make a form using ngForm directive.
  • Now get the value using AbstractControl value property
  • 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 '@angular/platform-browser/animations';
import { AppComponent }   from './app.component';
  bootstrap: [
  declarations: [
  imports: [
export class AppModule { }


<form #gfg = "ngForm">
    Name: <input type="text" name = 'name' ngModel>
    Date: <input type="date" name = 'date' ngModel>
{{ gfg.value | json }}



My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!