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