Sei qui: Home Page -> Notes -> Tech -> What is data binding?

What is data binding? Which type of data binding does Angular deploy?

In general, data binding refers to the process of establishing a connection between the application UI and the data it displays. It allows the UI to automatically update when the data changes, and vice versa.

Angular, a JavaScript framework for building web applications, uses a type of data binding called two-way data binding. With two-way data binding, any changes made to the UI are automatically reflected in the application data, and any changes made to the application data are automatically reflected in the UI. This makes it easy to build interactive and dynamic applications with Angular.

Here is an example of how two-way data binding works in Angular:

<input [(ngModel)]="name">

<p>Hello {{name}}!</p>


In this example, the input element is bound to the name property using the ngModel directive. The ngModel directive is a two-way data binding directive, meaning it binds the value of the input element to the name property, and it also binds the value of the name property to the input element. This means that when the user types something into the input element, the value of the name property is updated, and the p element is automatically updated to display the new value.
Sei qui: Home Page -> Notes -> Tech -> What is data binding?