Problem Statement
Explain two-way data binding with an example.
Explanation
Two-way binding keeps the input and component field in sync. When the user types, the component updates. When the component changes the value, the input updates. Use `[(ngModel)]` from `FormsModule` for template-driven forms.
Code Solution
SolutionRead Only
// app.component.html
<input [(ngModel)]="name" placeholder="Your name">
<p>Hello {{name}}</p>
// app.module.ts
imports: [BrowserModule, FormsModule]