Angular 9/8 Material Input Box Examples

Rate this post

Today, We want to share with you Angular 9/8 Material Input Box Examples.In this post we will show you Angular Material Form Controls, Form Field and Input Examples, hear for angular material form validation we will give you demo and example for implement.In this post, we will learn about Material Input Box with Reactive Form with an example.

Angular 9/8 Material Input Box Examples

There are the Following The simple About Modal Popup Example and Tutorial with Angular 9/8 Material Full Information With Example and source code.

Free Live Chat for Any Issue

As I will cover this Post with live Working example to develop Angular 9/8 Material Examples: Date Picker, Input, CheckBox, so the mat-input-container is used for this example is following below.

Read Also:  Sweet Alert confirmation before delete in Laravel 5.7

Angular Material Input Box Example



<h1>Angular Material Input Box Example -</h1>
<form [formGroup]="form" (ngSubmit)="submit()">
  <mat-form-field class="example-full-width">
      <input matInput placeholder="Ex. Kohali" formControlName="name">
      <mat-error *ngIf="form.get('name').hasError('required')">
        Name Field is required
  <mat-form-field class="example-full-width">
      <input matInput placeholder="Ex. [email protected]" formControlName="email">
      <mat-error *ngIf="form.get('email').hasError('required')">
        Email Field is required
      <mat-error *ngIf="form.get('email').hasError('email')">
        Must be enter valid email
  <button mat-raised-button color="purple">Submit</button>


import { Component } from '@angular/core';
import { FormBuilder, FormGroup, Validators} from '@angular/forms';
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
export class AppComponent {
  title = 'app-gretting';
  form: FormGroup = new FormGroup({});
  constructor(private fb: FormBuilder) {
    this.form ={
      name: ['', [Validators.required]],
      email: ['', [Validators.required,]],
  get f(){
    return this.form.controls;

Web Programming Tutorials Example with Demo

Read :

Read Also:  install node on windows


You can also read about AngularJS, ASP.NET, VueJs, PHP.


I hope you get an idea about mat-form-field appearance=outline.
I would like to have feedback on my blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.