When you want to avoid unnecessary change detection cycles for components with data that doesn't change, you can set their change detection strategy to ChangeDetectionStrategy.______.

  • Default
  • Lazy
  • OnPush
  • Smart
To avoid unnecessary change detection cycles for components with data that doesn't change frequently, you can set their change detection strategy to ChangeDetectionStrategy.OnPush. This strategy makes the component's change detection dependent on its input properties, resulting in better performance. The Default strategy doesn't optimize for this scenario. Lazy and Smart are not valid change detection strategies in Angular.
Add your answer
Loading...

Leave a comment

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