What is the main purpose of Angular's ChangeDetectionStrategy.OnPush?
- To enable two-way data binding.
- To improve change detection performance.
- To disable change detection altogether.
- To increase the framework's size.
The main purpose of Angular's ChangeDetectionStrategy.OnPush is to improve change detection performance. When you use this strategy, Angular will only perform change detection when input properties of a component change or when certain events are triggered, leading to better performance in applications with complex component trees. The other options are not the main purpose of this strategy.
Loading...
Related Quiz
- Which property of a FormControl instance would you check to determine if the user has interacted with a particular form control?
- How can you manually request a change detection cycle for a specific component?
- What's the main advantage of using HttpInterceptor over handling errors directly in the component or service?
- In the context of NgRx, when an action is dispatched, it is processed by a ________ to produce a new state.
- Your application needs to handle API rate limits. Which tool or method in Angular would you use to delay retries on a failed HTTP request?