MCPcopy Create free account
hub / github.com/angular/angular / newChild

Method newChild

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

getChildMethod · 0.65
newChildMethod · 0.65

Tested by

no test coverage detected