Lesson 5 / 30

Interpolation & Property Binding

Get data from your class into the template.

Interpolation

{{ expression }} inserts a value as text inside the template.

<h1>{{ title }}</h1>
<p>Total: {{ price * quantity }}</p>

Property binding

[property]="expression" binds a DOM property (not just text) to a class value.

<img [src]="photoUrl" [alt]="photoAlt">
<button [disabled]="isSaving">Save</button>

One-way, class to view

Both are one-way: data flows from the component class to the template. Change the class field and the view updates automatically.