Event Binding

noun

say it: “ih-VENT BYND-ing” /ɪˈvɛnt ˈbaɪndɪŋ/

The ( ) syntax that runs component code when an event happens, such as (click).

What is Event Binding?

Event binding uses parentheses to run component code when something happens in the page, like a click or a key press.

<button (click)="likePost()">Like</button>
<input (keyup.enter)="search()" />

In a sentence

  • “Event binding, (click)="add()", adds the product when the button is clicked.”

Level: Novice · More Angular terms at this level

Updated