In Angular, we can categorize data binding types into three categories distinguished by the direction of data flow. These data binding categories are:
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 |
Submitted questions and answers are subject to review and editing, and may or may not be selected for posting, at the sole discretion of w3Sniff.
Get Started
Comments
Leave a Comment