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

Method appendDirectiveInputs

packages/compiler/src/typecheck/ops/scope.ts:742–771  ·  view source on GitHub ↗
(
    dir: TcbDirectiveMetadata,
    node: Element | Template,
    dirMap: Map<TcbDirectiveMetadata, number>,
    allDirectiveMatches: TcbDirectiveMetadata[],
    directiveIndex?: number,
  )

Source from the content-addressed store, hash-verified

740 }
741
742 private appendDirectiveInputs(
743 dir: TcbDirectiveMetadata,
744 node: Element | Template,
745 dirMap: Map<TcbDirectiveMetadata, number>,
746 allDirectiveMatches: TcbDirectiveMetadata[],
747 directiveIndex?: number,
748 ): void {
749 const nodeIsFormControl = isFormControl(allDirectiveMatches);
750 const customFormControlType = nodeIsFormControl ? getCustomFieldDirectiveType(dir) : null;
751
752 const directiveOp = this.getDirectiveOp(dir, node, customFormControlType, directiveIndex);
753 const dirIndex = this.opQueue.push(directiveOp) - 1;
754 dirMap.set(dir, dirIndex);
755
756 if (isNativeField(dir, node, allDirectiveMatches)) {
757 const inputType =
758 (node.name === 'input' && node.attributes.find((attr) => attr.name === 'type')?.value) ||
759 null;
760
761 this.opQueue.push(
762 inputType === 'radio'
763 ? new TcbNativeRadioButtonFieldOp(this.tcb, this, node)
764 : new TcbNativeFieldOp(this.tcb, this, node, inputType),
765 );
766 }
767
768 this.opQueue.push(
769 new TcbDirectiveInputsOp(this.tcb, this, node, dir, nodeIsFormControl, customFormControlType),
770 );
771 }
772
773 private getDirectiveOp(
774 dir: TcbDirectiveMetadata,

Calls 7

getDirectiveOpMethod · 0.95
isFormControlFunction · 0.90
isNativeFieldFunction · 0.90
setMethod · 0.65
pushMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected