Feature request: Enforce value of @Component.changeDetection
See original GitHub issueIn the project I’m currently working on, it’d be useful to ensure that all components are set to use changeDetection: ChangeDetectionStrategy.OnPush
.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:37
- Comments:22 (10 by maintainers)
Top Results From Across the Web
Angular OnPush Change Detection - Avoid Common Pitfalls
Let's have a look at a simple component that does not use yet OnPush change detection, it's a newsletter component: we will use...
Read more >Angular Change Detection and the OnPush Strategy - Toptal
The question that Angular asks in the default change detection strategy is: Has any value in the model changed? But for a reference...
Read more >Avoid common pitfalls when using OnPush change detection ...
By default, it walks the application component's tree, an array, from start to finish. On its way, it searches for children and values...
Read more >Angular change detection OnPush with examples | by Da Feng
It checks for all components and child components when anything from a click event to an Input binding changes, which is not quite...
Read more >What's The Hype With Angular's OnPush Change Detection ...
These occasions include Network requests, mouse clicks, mouse scrolls, mouse moves, keyboard events, component events, timeouts, intervals, and ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@mgechev How about enforcing the existence of changeDetection? At least this way, it’s a conscious decision by the developer to say whether it is or not. This would prevent accidental default change detection by an accidental omission.
We’re working on optimizing on of our apps right now, and one of the measures we take is to make all the components to use
ChangeDetectionStrategy.onPush
, while during the transition period we would also like to whitelist some components that haven’t been updated yet. So this feature would be very beneficial for us 👍