DEV Community

Umme Q
Umme Q

Posted on

5 1

Data Binding in Angular

Data Binding is used bind the View (Html content) with Controller’s (Component’s) field. That is whenever we display dynamic data on a view (HTML) from Component, data binding is used.

Angular provides various types of data binding
1.Property 2.Attribute 3.Class 4.Style

1.Property Binding
Here we bind a property of a DOM element to a field which is a property we define in our component typescript code.
Example:
Alt Text

2.Attribute Binding
Here we bind attribute of an element with the field of a component.
Example:
Alt Text

3.Class Binding
Class binding is used when we want to add additional classes to an element based on some condition.
Example :
Alt Text

4.Style Binding
Here we bind a component field to our inline HTML styles.
Example :
Alt Text

Image of Datadog

Master Mobile Monitoring for iOS Apps

Monitor your app’s health with real-time insights into crash-free rates, start times, and more. Optimize performance and prevent user churn by addressing critical issues like app hangs, and ANRs. Learn how to keep your iOS app running smoothly across all devices by downloading this eBook.

Get The eBook

Top comments (0)