mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
Adds `ChangeDetectionStrategy.Eager` as an explicit alias for `ChangeDetectionStrategy.Default`. This improves readability when contrasting with `OnPush`, clarifying that the component will be checked eagerly when traversal reaches it. Compiler findings: - The compiler resolves `ChangeDetectionStrategy` enum members by value in `resolveEnumValue` (see `packages/compiler-cli/src/ngtsc/annotations/common/src/evaluation.ts`). - Since `Eager` has usage value `1` (same as `Default`), it is correctly interpreted during static analysis. - At runtime, `defineComponent` (in `packages/core/src/render3/definition.ts`) checks `changeDetection === ChangeDetectionStrategy.OnPush` (0). Any other value, including `1` (Eager/Default), results in eager checking behavior (`onPush: false`). |
||
|---|---|---|
| .. | ||
| design | ||
| src | ||
| test | ||
| BUILD.bazel | ||
| compiler.ts | ||
| index.ts | ||
| package.json | ||
| public_api.ts | ||