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

Method appendDirectiveInputs

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

Source from the content-addressed store, hash-verified

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