Performance: Property binding with square brackets
MEDIUM IMPACT
This affects how efficiently Angular updates DOM element properties during rendering and user interaction.
<input [value]="username"><input value="{{username}}">| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Interpolation in attribute (value="{{username}}") | Updates attribute node | Triggers reflow on each change | Higher paint cost due to layout recalculation | [X] Bad |
| Property binding ([value]="username") | Updates DOM property directly | Single reflow per update | Lower paint cost, smoother rendering | [OK] Good |