fix(ivy): properly insert views before ng-container with injected ViewContainerRef (#33853)

PR Close #33853
This commit is contained in:
Pawel Kozlowski
2019-11-15 12:18:00 +01:00
committed by Alex Rickabaugh
parent 839ac3c0a7
commit c7a3694eb9
2 changed files with 38 additions and 2 deletions

View File

@ -682,7 +682,6 @@ function getFirstNativeNode(lView: LView, tNode: TNode | null): RNode|null {
TNodeType.IcuContainer, TNodeType.Projection);
const tNodeType = tNode.type;
if (tNodeType === TNodeType.Element) {
return getNativeByTNode(tNode, lView);
} else if (tNodeType === TNodeType.Container) {
@ -692,7 +691,12 @@ function getFirstNativeNode(lView: LView, tNode: TNode | null): RNode|null {
if (elIcuContainerChild !== null) {
return getFirstNativeNode(lView, elIcuContainerChild);
} else {
return getNativeByTNode(tNode, lView);
const rNodeOrLContainer = lView[tNode.index];
if (isLContainer(rNodeOrLContainer)) {
return getBeforeNodeForView(-1, rNodeOrLContainer);
} else {
return unwrapRNode(rNodeOrLContainer);
}
}
} else {
const componentView = lView[DECLARATION_COMPONENT_VIEW];