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. This is lesson 1 of 4. Any 3 lessons of this learning path are free to read in full — after that, CoddyKit PRO unlocks every lesson, plus hands-on practice with a built-in code editor and a 24/7 AI tutor. It is part of the Angular Academy learning path, and your progress syncs across the web and the CoddyKit app. The Angular Academy course includes 4 lessons in total.
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.
Learn HTML with an AI tutor — free
Write and run real code in your browser, get instant help from a 24/7 AI tutor, and pick up where you left off on the web or in the app.
- Courses
- 38
- Lessons
- 144
Frequently Asked Questions
Is the “Property and Event Binding Recap” lesson free?
Yes — any 3 lessons of the Angular Academy learning path, including “Property and Event Binding Recap”, are free to read in full here on the web. After that, CoddyKit PRO unlocks every lesson, plus interactive practice with a built-in code editor and a 24/7 AI tutor. The Angular Academy course includes 4 lessons in total.
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, so you can start here or from the beginning and move at your own pace. This is lesson 1 of 4.
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