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

Method newChild

packages/forms/signals/src/field/node.ts:486–510  ·  view source on GitHub ↗
(key: string, trackingId: TrackingKey | undefined, isArray: boolean)

Source from the content-addressed store, hash-verified

484 }
485
486 private newChild(key: string, trackingId: TrackingKey | undefined, isArray: boolean): FieldNode {
487 // Determine the logic for the field that we're defining.
488 let childPath: FieldPathNode | undefined;
489 let childLogic: LogicNode;
490 if (isArray) {
491 // Fields for array elements have their logic defined by the `element` mechanism.
492 // TODO: other dynamic data
493 childPath = this.pathNode.getChild(DYNAMIC);
494 childLogic = this.structure.logic.getChild(DYNAMIC);
495 } else {
496 // Fields for plain properties exist in our logic node's child map.
497 childPath = this.pathNode.getChild(key);
498 childLogic = this.structure.logic.getChild(key);
499 }
500
501 return this.fieldAdapter.newChild({
502 kind: 'child',
503 parent: this as ParentFieldNode,
504 pathNode: childPath,
505 logic: childLogic,
506 initialKeyInParent: key,
507 identityInParent: trackingId,
508 fieldAdapter: this.fieldAdapter,
509 });
510 }
511}
512
513const EMPTY = computed(() => []);

Callers

nothing calls this directly

Calls 2

getChildMethod · 0.65
newChildMethod · 0.65

Tested by

no test coverage detected