MCPcopy Index your code
hub / github.com/angular/angular / linkTNodeInTView

Function linkTNodeInTView

packages/core/src/render3/tnode_manipulation.ts:178–203  ·  view source on GitHub ↗
(
  tView: TView,
  tNode: TNode,
  currentTNode: TNode | null,
  isParent: boolean,
)

Source from the content-addressed store, hash-verified

176}
177
178function linkTNodeInTView(
179 tView: TView,
180 tNode: TNode,
181 currentTNode: TNode | null,
182 isParent: boolean,
183) {
184 if (tView.firstChild === null) {
185 tView.firstChild = tNode;
186 }
187 if (currentTNode !== null) {
188 if (isParent) {
189 // FIXME(misko): This logic looks unnecessarily complicated. Could we simplify?
190 if (currentTNode.child == null && tNode.parent !== null) {
191 // We are in the same view, which means we are adding content node to the parent view.
192 currentTNode.child = tNode;
193 }
194 } else {
195 if (currentTNode.next === null) {
196 // In the case of i18n the `currentTNode` may already be linked, in which case we don't want
197 // to break the links which i18n created.
198 currentTNode.next = tNode;
199 tNode.prev = currentTNode;
200 }
201 }
202 }
203}
204
205/**
206 * Constructs a TNode object from the arguments.

Callers 1

createTNodeAtIndexFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…