In Angular, we can categorize data binding types in three categories distinguished by the direction of data flow. These data binding categories are:
- From the source-to-view
- From view-to-source
- View-to-source-to-view
Let's see their possible binding syntax:
Data direction | Syntax | Type |
---|
From the source-to-view(One-way data binding) | 1. {{expression}} 2. [target]="expression" 3. bind-target="expression" | Interpolation, Property, Attribute, Class, Style |
From view-to-source(One-way data binding) | 1. (target)="statement" 2. on-target="statement" | Event |
View-to-source-to-view(Two-way data binding) | 1. [(target)]="expression" 2. bindon-target="expression" | Two-way data binding |