← Angular learning pathAngular · Module 3 of 10
Data binding
Connect class data to the template with interpolation, property, event and two-way binding.
📖 Key ideas
- Interpolation shows values: {{ title }}.
- Property binding sets properties: [src]="imageUrl".
- Event binding listens: (click)="save()".
- Two-way binding: [(ngModel)]="name" (needs FormsModule).
- Banana in a box: [( )] = two-way.
💡 Real-life example: Binding is a two-way radio: the class talks to the template and the template talks back.
{{ }}Interpolation of a value
[prop]Property binding
(event)Event binding
[(ngModel)]Two-way binding