Event Binding in Angular 8 Last Updated : 14 Sep, 2020 Summarize Suggest changes Share Like Article Like Report In Angular 8, event binding is used to handle the events raised by the user actions like button click, mouse movement, keystrokes, etc. When the DOM event happens at an element(e.g. click, keydown, keyup), it calls the specified method in the particular component. Using Event Binding we can bind data from DOM to the component and hence can use that data for further purposes. Syntax: < element (event) = function() > Approach: Define a function in the app.component.ts file which will do the given task.In the app.component.html file, bind the function to the given event on the HTML element. Example 1: Using click event on the input element. app.component.html HTML <h1> GeeksforGeeks </h1> <input (click)="gfg($event)" value="Geeks"> app.component.ts JavaScript import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { gfg(event) { console.log(event.toElement.value); } } Output: Example 2: Using keyup event on the input element. app.component.html HTML <!-- event is passed to function --> <input (keyup)="onKeyUp($event)"> <p>{{text}}</p> app.component.ts JavaScript import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { text = ''; onKeyUp(x) { // Appending the updated value // to the variable this.text += x.target.value + ' | '; } } Output: Advertise with us Next Article Angular PrimeNG Button Events T taran910 Follow Similar Reads Binding Syntax In Angular In Angular, binding syntax lets you determine the channel of data transmission between the component class and the template. Among various types of bindings supported by Angular are interpolation, property binding, event binding, and two-way-data-binding. Therefore, it is important to understand var 3 min read Angular PrimeNG Dialog Events Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. In this article, we will know how to use the Dialog Events in Angular PrimeNG. The Dialog Component 3 min read Event Calender using Angular In this article, we will walk through the steps to create a dynamic Event Calendar using Angular 17 standalone components. This calendar will allow users to add events to specific dates and view them interactively. We will utilize Angular's powerful features and best practices to build a clean and e 6 min read Angular PrimeNG Button Events Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. This article will show us how to style the Tooltip component in Angular PrimeNG. A Button is general 4 min read Angular PrimeNG BlockUI Events Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. In this article, we will know about Angular PrimeNG BlockUI Events. The BlockUI component is used to 3 min read Angular 10 (blur) Event 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. 1 min read Article Tags : Web Technologies AngularJS AngularJS-Misc Like