angular/packages/core
Andrew Scott a4e749ffca fix(core): When using setInput, mark view dirty in same was as markForCheck (#49711)
`ComponentRef.setInput` internally calls `markDirtyIfOnPush` which only marks
the given view as dirty but does not mark parents dirty like `ChangeDetectorRef.markForCheck` would.
f071224720/packages/core/src/render3/instructions/shared.ts (L1018-L1024)

`markDirtyIfOnPush` has an assumption that it’s being called from the parent’s template. That is, we don’t need to mark dirty to the root, because we’ve already traversed down to it.
The function used to only be called during template execution for input
bindings but was added to `setInput` later. It's not a good fit because
it means that if you are responding to events such as an emit from an `Observable`
and call `setInput`, the view of your `ComponentRef` won't necessarily get checked
when change detection runs next. If this lives inside some `OnPush` component tree
that's not already dirty, it only gets refreshed if you also call
`ChangeDetectorRef.markForCheck` in the host component (because it will be "shielded" be a non-dirty parent).

PR Close #49711
2023-04-05 10:13:21 -07:00
..
global build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
rxjs-interop test(core): fix rxjs-interop tests which fail due to collision (#49651) 2023-03-30 11:06:48 -07:00
schematics refactor(migrations): remove migrations from previous versions (#49603) 2023-03-28 11:42:00 -07:00
src fix(core): When using setInput, mark view dirty in same was as markForCheck (#49711) 2023-04-05 10:13:21 -07:00
test fix(core): When using setInput, mark view dirty in same was as markForCheck (#49711) 2023-04-05 10:13:21 -07:00
testing docs: fix typo (#49669) 2023-04-03 19:18:40 -07:00
BUILD.bazel build(core): introduce @angular/core/rxjs-interop entrypoint (#49154) 2023-03-30 09:44:38 -07:00
index.ts refactor(core): made comment structure consistent in index.ts (#43684) 2021-10-21 18:39:58 +00:00
package.json feat(core): drop support for zone.js versions <=0.12.0 (#49331) 2023-03-07 19:12:22 +00:00
PACKAGE.md docs: add package doc files (#26047) 2018-10-05 15:42:14 -07:00
public_api.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00