(
dir: TcbDirectiveMetadata,
node: DirectiveOwner,
customFieldType: CustomFormControlType | null,
directiveIndex?: number,
)
| 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) { |
no outgoing calls
no test coverage detected