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

Method getDirectiveOp

packages/compiler/src/typecheck/ops/scope.ts:769–789  ·  view source on GitHub ↗
(
    dir: TcbDirectiveMetadata,
    node: DirectiveOwner,
    customFieldType: CustomFormControlType | null,
    directiveIndex?: number,
  )

Source from the content-addressed store, hash-verified

767 }
768
769 private getDirectiveOp(
770 dir: TcbDirectiveMetadata,
771 node: DirectiveOwner,
772 customFieldType: CustomFormControlType | null,
773 directiveIndex?: number,
774 ): TcbOp {
775 if (!dir.isGeneric) {
776 // The most common case is that when a directive is not generic, we use the normal
777 // `TcbNonDirectiveTypeOp`.
778 return new TcbNonGenericDirectiveTypeOp(this.tcb, this, node, dir, directiveIndex);
779 } else if (!dir.requiresInlineTypeCtor || this.tcb.env.config.useInlineTypeConstructors) {
780 // For generic directives, we use a type constructor to infer types. If a directive requires
781 // an inline type constructor, then inlining must be available to use the
782 // `TcbDirectiveCtorOp`. If not we, we fallback to using `any` – see below.
783 return new TcbDirectiveCtorOp(this.tcb, this, node, dir, customFieldType, directiveIndex);
784 }
785
786 // If inlining is not available, then we give up on inferring the generic params, and use
787 // `any` type for the directive's generic parameters.
788 return new TcbGenericDirectiveTypeWithAnyParamsOp(this.tcb, this, node, dir, directiveIndex);
789 }
790
791 private appendSelectorlessDirectives(node: Element | Template | Component): void {
792 for (const directive of node.directives) {

Callers 2

appendDirectiveInputsMethod · 0.95
appendHostElementMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected