Performance: Event binding with parentheses
MEDIUM IMPACT
This affects how quickly user interactions trigger JavaScript code and how efficiently the browser updates the UI in response.
<button (click)="doSomething()">Click me</button><button onclick="doSomething()">Click me</button>| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Inline HTML event handlers | No extra DOM nodes, but inline attributes parsed | Minimal reflows | Low paint cost | [!] OK |
| Angular (click) event binding per element | Adds native event listeners per element | Minimal reflows | Low paint cost | [OK] Good |
| Angular event binding with delegation | Single event listener on parent | Minimal reflows | Low paint cost | [OK] Good |