VOOZH about

URL: https://www.geeksforgeeks.org/angular-js/angular-10-blur-event/

⇱ Angular 10 (blur) Event - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Angular 10 (blur) Event

Last Updated : 4 Jul, 2021

In this article, we are going to see what is blur event in Angular 10 and how to use it. The blur event is triggered when an element loses its focus.

Syntax:

<input (blur)='functionName()'/>

NgModule: Module used by blur event is:

  • CommonModule

Approach:

  • Create an Angular app to be used.
  • In app.component.ts make a function that triggers on blur event.
  • In app.component.html make an input element and set blur event.
  • Serve the angular app using ng serve to see the output.
 

Example 1:

Output:

👁 Image

Example 2:

Output:

👁 Image
Comment
Article Tags:

Explore