mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
This change updates the approach to the loop in `ApplicationRef.tick` for allowing state updates in `afterRender` hooks. It is valid to update state in render hooks and we need to ensure we refresh views that may be marked for check in these hooks (this can happen simply as a result of focusing an element). This change ensures that the behavior of `markForCheck` with respect to this loop does not change while we are actively running change detection on a view tree. This approach also has the benefit of preventing a regression for #18917, where updating state in animation listeners can cause `ExpressionChanged...Error` This should be allowed - there is nothing wrong with respect to unidirectional data flow in this case. There may be other cases in the future where it is valid to update state. Rather than wrapping the render hooks and the animation flushing in something which flips a global state flag, the idea here is that `markForCheck` is safe and valid in all cases whenever change detection is not actively running. PR Close #54900 |
||
|---|---|---|
| .. | ||
| global | ||
| primitives/signals | ||
| reference-manifests | ||
| rxjs-interop | ||
| schematics | ||
| src | ||
| test | ||
| testing | ||
| BUILD.bazel | ||
| index.ts | ||
| package.json | ||
| PACKAGE.md | ||
| public_api.ts | ||