* Locates the next tNode (child, sibling or parent).
(tNode: TNode)
| 245 | * Locates the next tNode (child, sibling or parent). |
| 246 | */ |
| 247 | function traverseNextElement(tNode: TNode): TNode | null { |
| 248 | if (tNode.child) { |
| 249 | return tNode.child; |
| 250 | } else if (tNode.next) { |
| 251 | return tNode.next; |
| 252 | } else { |
| 253 | // Let's take the following template: <div><span>text</span></div><component/> |
| 254 | // After checking the text node, we need to find the next parent that has a "next" TNode, |
| 255 | // in this case the parent `div`, so that we can find the component. |
| 256 | while (tNode.parent && !tNode.parent.next) { |
| 257 | tNode = tNode.parent; |
| 258 | } |
| 259 | return tNode.parent && tNode.parent.next; |
| 260 | } |
| 261 | } |
| 262 | |
| 263 | /** |
| 264 | * Locates the component within the given LView and returns the matching index |
no outgoing calls
no test coverage detected
searching dependent graphs…