Two-Way Binding

Two-way binding in Angular allows data to flow in both directions between the component and the template.

Snippet:

<input [(ngModel)]="username"> <p>Hello, {{ username }}!</p>

Example:

<input [(ngModel)]="name"> <p>Welcome, {{ name }}!</p>