Performance: Form validation with template attributes
MEDIUM IMPACT
This affects the interaction responsiveness and rendering speed during user input in forms.
<input name="email" ngModel required minlength="5">
<input name="email" ngModel required minlength="5" (input)="validateEmail($event.target.value)">
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Custom input event validation | High (many event handlers) | Multiple per keystroke | High due to frequent style updates | [X] Bad |
| Template attribute validation | Low (native attributes) | Single per input | Low, minimal style recalculations | [OK] Good |