Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
No
Description
Transplanted views (templates that are rendered into a different component than where they are declared) do not function properly when the declaration occurs after the insertion point in the change detector tree.
They almost always require checkNoChanges to be disabled, or else they will throw an ExpressionChangedAfterItHasBeenCheckedError. This happens when the inserted view is not dirty, so it is skipped during detectChanges, but then the declaration-owning view is checked, which calls markTransplantedViewsForRefresh.
On the following checkNoChanges run, it will check the transplanted view, which means any binding expression change will result in a ExpressionChangedAfterItHasBeenCheckedError.
To reproduce:
Remove the false from the fixture.detectChanges here (line 403).
|
fixture.detectChanges(false); |
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in (run ng version)
No response
Anything else?
No response
Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
No
Description
Transplanted views (templates that are rendered into a different component than where they are declared) do not function properly when the declaration occurs after the insertion point in the change detector tree.
They almost always require
checkNoChangesto be disabled, or else they will throw anExpressionChangedAfterItHasBeenCheckedError. This happens when the inserted view is not dirty, so it is skipped duringdetectChanges, but then the declaration-owning view is checked, which callsmarkTransplantedViewsForRefresh.On the following
checkNoChangesrun, it will check the transplanted view, which means any binding expression change will result in aExpressionChangedAfterItHasBeenCheckedError.To reproduce:
Remove the
falsefrom thefixture.detectChangeshere (line 403).angular/packages/core/test/acceptance/change_detection_transplanted_view_spec.ts
Line 403 in f9b821f
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in (run
ng version)No response
Anything else?
No response