Property and Event Binding Recap
Bind data into and events out of components.
Property and Event Binding Recap is a free Angular Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Angular Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Two Directions of Data Flow
Angular templates move data two ways: property binding pushes data into the DOM, and event binding sends user actions back to the component.
Interpolation
Interpolation with double curly braces renders a component value as text. It is one-way, component to view.
<p>{{ title }}</p>
// component
title = "Dashboard";Property Binding Syntax
Square brackets bind a component value to an element or component property. The expression on the right is evaluated and assigned.
<img [src]="imageUrl" [alt]="caption">
// component
imageUrl = "/logo.png";
caption = "Logo";Binding to Component Inputs
Property binding also feeds values into child component @Input properties.
<app-user [name]="userName"></app-user>
// parent component
userName = "Ada";Attribute vs Property
Property binding targets DOM properties, not HTML attributes. For pure attributes use the attr. prefix.
<button [attr.aria-label]="label">Save</button>Event Binding Syntax
Parentheses bind a DOM event to a component method. The method runs when the event fires.
<button (click)="save()">Save</button>
// component
save() { console.log("saved"); }The $event Object
The special $event variable carries the event payload into your handler.
<input (input)="onInput($event)">
// component
onInput(e: Event) {
this.text = (e.target as HTMLInputElement).value;
}Binding to Component Outputs
Event binding also listens to child component @Output events emitted via an EventEmitter.
<app-counter (changed)="onChange($event)"></app-counter>
// parent
onChange(value: number) { this.count = value; }Combining Both Bindings
Using property binding and event binding together on the same property is the foundation of two-way binding, which you will see next.
<input [value]="name" (input)="name = $event.target.value">Class and Style Bindings
Special property bindings toggle classes and styles based on component state.
<div [class.active]="isActive"
[style.color]="textColor">
Item
</div>Keeping Templates Declarative
Bindings keep the relationship between data and view declarative. Angular updates the DOM automatically when bound values change.
Quick Check
Test your understanding of property and event binding.
Recap
Property binding [prop] pushes data to the view, event binding (event) sends actions back, and interpolation renders text. Combining a property and event binding on the same value sets up two-way binding.
Frequently asked questions
Is the “Property and Event Binding Recap” lesson free?
Yes — the full text of “Property and Event Binding Recap” is free to read here on the web, and the Angular Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Angular Academy course, upgrade to CoddyKit PRO.
What will I learn in “Property and Event Binding Recap”?
Bind data into and events out of components. You practise Angular Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Angular Academy?
No prior experience is required. Angular Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Property and Event Binding Recap” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Angular Academy lesson?
Yes. Every Angular Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Property and Event Binding Recap
- Two-Way Binding with ngModel
- model() Signal Inputs
- Custom Two-Way Bindable Properties