Performance: Two-way binding with ngModel
MEDIUM IMPACT
This affects input responsiveness and rendering speed by syncing UI and data model automatically.
<input [(ngModel)]="name"><input [value]="name" (input)="name = $event.target.value">
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Manual input binding with [value] and (input) | Multiple DOM updates per event | Multiple reflows if layout changes | Higher paint cost due to frequent updates | [X] Bad |
| Two-way binding with [(ngModel)] | Single DOM update per event | Single reflow per input | Lower paint cost with optimized updates | [OK] Good |