Performance: Access modifiers in components
MEDIUM IMPACT
Access modifiers affect how component properties and methods are exposed, impacting template binding and change detection performance.
export class MyComponent { private data = []; updateData() { // update logic } }
export class MyComponent { public data = []; public updateData() { // update logic } }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Public properties bound in template | High (many bindings) | Medium (due to frequent updates) | Medium | [X] Bad |
| Private properties not bound in template | Low (fewer bindings) | Low | Low | [OK] Good |