mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
In Angular today, a bound listener automatically marks the view for check. When using ZoneJS, these listeners are most often executed in the Angular Zone as well, so synchronization (`ApplicationRef.tick`) will eventually happen. _However_, developers can opt out of zone-patching for events in several ways, and often do this for very frequent listeners like `mousemove`, `resize`, and `scroll`. We do not want to break existing expectations that these are now "safe" events to have listeners for by automatically scheduling change detection regardless of whether the listener executed inside or outside the Angular zone. In contrast, in order for developers to more easily transition to zoneless, we need to be able to ensure that components which are using `OnPush` are, for the most part, compatible with zoneless as well. Because listeners automatically mark the component for check, developers using `OnPush` did not/do not need to also call `ChangeDetectorRef.markForCheck` or a similar API. Unfortunately, this means that we need to consider the listener callbacks as a notification to schedule a `tick` when Zoneless is enabled. In the future, we would like to have an opt-out for this (i.e. signal components) since it's not really how we _want_ things to work. Also includes the fix for #54919 that got reverted only because it was easier to revert the set of conflicting commits PR Close #55525 |
||
|---|---|---|
| .. | ||
| animations | ||
| src | ||
| test | ||
| testing | ||
| BUILD.bazel | ||
| index.ts | ||
| package.json | ||
| PACKAGE.md | ||
| public_api.ts | ||