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.
Loading...
Related Quiz
- When setting up routing in Angular, where do you usually define the paths and their associated components?
- If two modules provide the same service and are imported into a third module, the service from the ________ module will be used.
- You're building a carousel component that requires initialization logic after its views are rendered. Which lifecycle hook would be most appropriate for this?
- To capture changes in the @Input() property, one should implement the ______ interface.
- Where in an Angular application would you typically define child routes?