You have a component that receives a large list of items as an input. You notice performance degradation when items within this list are updated frequently. Which change detection strategy would be most appropriate to address this?

  • OnPush Change Detection
  • Default Change Detection
  • CheckAlways Change Detection
  • Detached Change Detection
In this scenario, when dealing with frequent updates to a large list of items, using the OnPush change detection strategy is most appropriate. It allows the component to only re-render when its input properties change or when explicitly triggered, which can significantly improve performance by reducing unnecessary updates. Default change detection (Option 2) checks for changes on every digest cycle, leading to performance issues in this scenario. CheckAlways (Option 3) and Detached (Option 4) are not recommended for typical use cases.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *