
- Angular Tutorial
- Angular - Home
- Angular - Overview
- Angular - Features
- Angular - Advantages & Disadvantages
- Angular Basics
- Angular - Environment setup
- Angular - First Application
- Angular - MVC Architecture
- Angular Components
- Angular - Components
- Angular - Component Lifecycle
- Angular - View Encapsulation
- Angular - Component Interaction
- Angular - Component Styles
- Angular - Nested Components
- Angular - Content projection
- Angular - Dynamic components
- Angular - Elements
- Angular Templates
- Angular - Templates
- Angular - Template statements
- Angular - Template Variables
- Angular - SVG as Templates
- Angular Binding
- Angular - Data Binding
- Angular - Interpolation
- Angular - Event Binding
- Angular - Property Binding
- Angular - Attribute Binding
- Angular - Class Binding
- Angular - Style Binding
- Angular - Two-way Binding
- Angular Directives
- Angular - Directives
- Angular - Attribute Directives
- Angular - Structural Directives
- Angular - Custom Directives
- Angular Pipes
- Angular - Pipes
- Angular - Built-in Pipes
- Angular - Custom Pipes
- Angular Forms
- Angular - Forms
- Angular - Template Driven Forms
- Angular - Reactive Forms
- Angular - Form Validation
- Angular - Dynamic Forms
- Angular Dependency Injection
- Angular - Dependency Injection
- Angular - Injectable Service
- Angular Routing
- Angular - Routing
- Angular - Dynamic Routes
- Angular - Wildcard Routes
- Angular - Nested Routes
- Angular - Navigation
- Angular - Routing in SPA
- Angular - Custom Route Matches
- Angular - Router Reference
- Angular HTTP Client programming
- Angular - Services
- Angular - HTTP Client
- Angular - Request
- Angular - Response
- Angular - GET
- Angular - POST
- Angular - PUT
- Angular - DELETE
- Angular - JSONP
- Angular - CRUD Operations Using HTTP
- Angular Modules
- Angular - Introduction to Modules
- Angular - Root Module
- Angular - Feature Module
- Angular - Sharing Module
- Angular - Routing Module
- Angular - NgModules
- Angular Animation
- Angular - Animations
- Angular Service Workers & PWA
- Angular - Service Workers & PWA
- Angular Testing
- Angular - Testing Overview
- Angular Design Patterns
- Angular - Design Patterns
- Angular - Lazy Loading
- Angular - Singleton Pattern
- Angular - Observer Pattern
- Angular Libraries
- Angular - Libraries
- Angular - Angular Material
- Angular - PrimeNG
- Angular - RxJS
- Angular Advanced
- Angular - Signals
- Angular - Authentication & Authorization
- Angular - Internationalization
- Angular - Standalone Component
- Angular - Accessibility
- Angular - Web Workers
- Angular - Server Side Rendering
- Angular - Ivy Compiler
- Angular - Building with Bazel
- Angular - Backward Compatibility
- Angular - Reactive Programming
- Angular Tools
- Angular - CLI
- Angular Material UI Elements
- Angular - Paginator
- Angular - Datepicker
- Angular - Select Drop-down
- Angular Miscellaneous
- Angular - Third Party Controls
- Angular - Configuration
- Angular - Displaying Data
- Angular - Decorators & Metadata
- Angular - Basic Example
- Angular - Error Handling
- Angular - Testing & Building a Project
- Angular - Lifecycle Hooks
- Angular - User Input
- Angular - What's New?
- Angular Useful Resources
- Angular - Quick Guide
- Angular - Useful Resources
- Angular - Discussion
Angular - Data Binding
Data Binding is the process of connecting a target (such as a DOM element, property, or event) in a template to a model (data or behavior) in the component. This process lets the template to dynamically reflect changes in the component's state or execute actions based on user interactions, using template expressions or template statements.
In Angular, data binding is used to establish communication between component class to view template and view template to the component class.
Types of Data Binding
There are two types of Data Binding in Angular −
The diagram below shows the categorization of data binding −

One-Way Data Binding
One-way data binding is a one-directional interaction between a component and its template. The data flows either from component to its corresponding template or template to the component. If you perform any changes in your component, then it will reflect in the HTML elements.

One-way data binding can be achieved through the following ways −
Text Interpolation
In general,Text Interpolationis the process of formatting or manipulating strings. In Angular,itis used to display data from a component to a view. In this way of data binding, we use the curly braces {{ }}.
Let us consider a variable, name available in the component.
name: string = "John"
Then, the name can be used in the template using interpolation as shown below −
Name: {{ name }}
The final output of the template is shown below −
Name: John
Event Binding
Event binding is the process of setting an action to the event of an HTML element or another component. It is used to achieve one-way data binding where data flows from the view template to the component class. Here, we use the parentheses ( ).
Events are actions like a mouse click, double click, hover or any other keyboard and mouse actions. If a user interacts with an application and performs some actions, then an event will be raised.
Suppose there is a method called myAction() inside the component.
myAction() { // do some process }
For this, event binding can be written as shown below −
<button type="submit" (submit)="myAction">Click here</button>
Once the submit event is fired, myAction() method will be called and executed.
Property Binding
Property binding lets us bind a property of a DOM. It is used to show or hide a DOM element, or simply manipulate the DOM. Here, we use square brackets [ ]
Let us consider a property, name available in the component.
name: string = "John"
Property binding can be written as shown below −
<input type="text" name="username" [value]="name" />
The output of the template is shown below −
<input type="text" name="username" value="John" />
Attribute binding
Attribute binding is used to bind the data from component to HTML attributes. The syntax is as follows −
<HTMLTag [attr.ATTR]="Component data">
For example, let's consider a property, name available in the component.
name: string = "John"
Attribute binding can be written as shown below −
<input type="text" name="username" [attr.value]="name" />
The output of the template is shown below −
<input type="text" name="username" value="John" />
Two-way Data Binding
Two-way data binding is a two-way interaction where data flows in both ways, from component to views and views to component at the same time. If you do any changes in your property (or model) then, it reflects in your view and vice-versa. It is the combination of property and event binding.

The NgModel, a standalone Angular directive, is used for two-way data binding. This directive binds the form control to property and the property to form control.
The syntax of ngModel is as follows −
<HTML [(ngModel)]="model.name" />
A sample two-way data binding format is as follows,
// `parent-comp` template <child-comp [(data)]="dataChange()" />
Here, data will be passed initially from parent to child component and then, whenever the data gets updated in the child component, the child component will fire an event with updated data and the parent will capture the data through event callback method, dataChange().
We will learn two-way data binding concept in more detail in the upcoming chapter.
Conclusion
Binding provides multiple options to connect a component to it's template. This enables the developer to create rich front-end application easily. Binding reduces the complexity of front-end logic and enable developer to concentrate on developing more feature in a short period of time.
Multiple Choice Questions on Angular Data Binding
Based on the Angular data binding concept, there are three MCQs given below. Answer them correctly to test your knowledge about the topic −
Q. 1 - Use of data binding:
A - For communication between the component class and the view template
B - To manage the data flow between components
Answer : A
Explanation
In Angular, data binding is used to establish communication between component class to view template and view template to the component class.
Answer : D
Explanation
One-way data binding to bind data from the component to the view is done using square brackets [ ].
Q. 3 - Which of the following is used for two-way data binding?
Answer : B
Explanation
The [(ngModel)] syntax is used for two-way data binding in Angular.