question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: Enforce value of @Component.changeDetection

See original GitHub issue

In 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:closed
  • Created 7 years ago
  • Reactions:37
  • Comments:22 (10 by maintainers)

github_iconTop GitHub Comments

7reactions
guojenmancommented, Mar 10, 2017

@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.

4reactions
ajantschcommented, Aug 17, 2018

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 👍

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found