Hello
 
For that you can check it length or another way as given below
 
Online link :
 
https://check-textbox-is-empty-or-not-angular6.stackblitz.io/
 
Code :
 
.ts file :
 
  1. import { Component } from '@angular/core';  
  2.   
  3. @Component({  
  4.   selector: 'my-app',  
  5.   templateUrl: './app.component.html',  
  6.   styleUrls: [ './app.component.css' ]  
  7. })  
  8. export class AppComponent  {  
  9.   txtValue:string = null;  
  10.   message : string;  
  11.   
  12.   onTextChange(value)  
  13.   {  
  14.     this.txtValue = value;  
  15.     if(this.txtValue == '')  
  16.     {  
  17.       this.message="Textbox is empty !!!";  
  18.     }  
  19.       
  20.   }  
  21. }   
 
html file : 
 
  1. How To Check That Textbox is Null or Not : MAnav Pandya


      

  2.   
  3.   
  4.     
  5.     
  6.   
  7.       
  8.   
  9.       
  10.   
  11.     
  12.   
  13.     
  14.   
  15.     
  16.   
  17.   
  18. Enter any value :"text"  [(ngModel)]="txtValue" (ngModelChange)="onTextChange($event)" />  
  19.       
  20. {{txtValue}}{{message}}