mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
Previous implementation would fire changes `QueryList.changes.subscribe`
whenever the `QueryList` was recomputed. This resulted in artificially
high number of change notifications, as it is possible that recomputing
`QueryList` results in the same list. When the `QueryList` gets recomputed
is an implementation detail and it should not be the thing which determines
how often change event should fire.
This change introduces a new `emitDistinctChangesOnly` option for
`ContentChildren` and `ViewChildren`.
```
export class QueryCompWithStrictChangeEmitParent {
@ContentChildren('foo', {
// This option will become the default in the future
emitDistinctChangesOnly: true,
})
foos!: QueryList<any>;
}
```
PR Close #40091
|
||
|---|---|---|
| .. | ||
| BUILD.bazel | ||
| component_indexing_spec.ts | ||
| env.ts | ||
| incremental_error_spec.ts | ||
| incremental_spec.ts | ||
| modulewithproviders_spec.ts | ||
| monorepo_spec.ts | ||
| ngtsc_spec.ts | ||
| scope_spec.ts | ||
| sourcemap_utils.ts | ||
| template_mapping_spec.ts | ||
| template_typecheck_spec.ts | ||