fix(ivy): creation mode not run on view detached from change detection (#29741)

Fixes the creation mode block not being run on components which have been detached from change detection.

This PR resolves FW-1217.
Fixes #29645.

PR Close #29741
This commit is contained in:
Kristiyan Kostadinov
2019-04-06 10:10:54 +02:00
committed by Igor Minar
parent cb9ee3411f
commit 98cf3e8fcd
2 changed files with 28 additions and 3 deletions

View File

@ -1292,8 +1292,9 @@ export function componentRefresh(adjustedElementIndex: number): void {
const hostView = getComponentViewByIndex(adjustedElementIndex, lView);
ngDevMode && assertNodeType(lView[TVIEW].data[adjustedElementIndex] as TNode, TNodeType.Element);
// Only attached CheckAlways components or attached, dirty OnPush components should be checked
if (viewAttachedToChangeDetector(hostView) &&
// Only components in creation mode, attached CheckAlways
// components or attached, dirty OnPush components should be checked
if ((viewAttachedToChangeDetector(hostView) || isCreationMode(lView)) &&
hostView[FLAGS] & (LViewFlags.CheckAlways | LViewFlags.Dirty)) {
syncViewWithBlueprint(hostView);
checkView(hostView, hostView[CONTEXT]);