fix(ivy): properly find RNode (#23193)

As we no longer create native (RNode) comment nodes for containers,
we need to execute logic for finding a next sibiling node with RNode
when inserting a view.

The mentioned logic need to be updated for the case of dynamically
created containers (LContainerNode). Indeed, we need to be able to
descend into dynamically inserted views while looking for a RNode.
To achieve this we need to have a pointer from a host LNode to a
dynamically created LContainerNode).

PR Close #23193
This commit is contained in:
Pawel Kozlowski
2018-04-03 10:18:25 +02:00
committed by Igor Minar
parent 5cd36c7764
commit d80e9304c6
6 changed files with 189 additions and 23 deletions

View File

@ -80,13 +80,6 @@ export interface LContainer {
* this container are reported to queries referenced here.
*/
queries: LQueries|null;
/**
* If a LContainer is created dynamically (by a directive requesting ViewContainerRef) this fields
* keeps a reference to a node on which a ViewContainerRef was requested. We need to store this
* information to find a next render sibling node.
*/
host: LContainerNode|LElementNode|null;
}
/**

View File

@ -130,6 +130,11 @@ export interface LNode {
* data about this node.
*/
tNode: TNode|null;
/**
* A pointer to a LContainerNode created by directives requesting ViewContainerRef
*/
dynamicLContainerNode: LContainerNode|null;
}
@ -158,6 +163,7 @@ export interface LTextNode extends LNode {
/** LTextNodes can be inside LElementNodes or inside LViewNodes. */
readonly parent: LElementNode|LViewNode;
readonly data: null;
dynamicLContainerNode: null;
}
/** Abstract node which contains root nodes of a view. */
@ -169,6 +175,7 @@ export interface LViewNode extends LNode {
/** LViewNodes can only be added to LContainerNodes. */
readonly parent: LContainerNode|null;
readonly data: LView;
dynamicLContainerNode: null;
}
/** Abstract node container which contains other views. */
@ -199,6 +206,7 @@ export interface LProjectionNode extends LNode {
/** Projections can be added to elements or views. */
readonly parent: LElementNode|LViewNode;
dynamicLContainerNode: null;
}
/**