Performance: Interpolation with double curly braces
MEDIUM IMPACT
This affects the rendering speed of dynamic text content in Angular templates and how often the DOM updates when data changes.
<p>{{ fullName }}</p>
// In component: fullName = user.firstName + ' ' + user.lastName + ' - ' + status;<p>{{ user.firstName + ' ' + user.lastName + ' - ' + getStatus() }}</p>| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Interpolation with method calls | Multiple text node updates per cycle | Multiple reflows per change detection | High paint cost due to frequent updates | [X] Bad |
| Interpolation with precomputed properties | Single text node update per data change | Single reflow per update | Low paint cost | [OK] Good |