(type: Type<any>, metadata: Directive)
| 370 | * `Component`). |
| 371 | */ |
| 372 | export function directiveMetadata(type: Type<any>, metadata: Directive): R3DirectiveMetadataFacade { |
| 373 | // Reflect inputs and outputs. |
| 374 | const reflect = getReflect(); |
| 375 | const propMetadata = reflect.ownPropMetadata(type); |
| 376 | |
| 377 | return { |
| 378 | name: type.name, |
| 379 | legacyOptionalChaining: false, |
| 380 | type: type, |
| 381 | selector: metadata.selector !== undefined ? metadata.selector : null, |
| 382 | host: metadata.host || EMPTY_OBJ, |
| 383 | propMetadata: propMetadata, |
| 384 | inputs: metadata.inputs || EMPTY_ARRAY, |
| 385 | outputs: metadata.outputs || EMPTY_ARRAY, |
| 386 | queries: extractQueriesMetadata(type, propMetadata, isContentQuery), |
| 387 | lifecycle: {usesOnChanges: reflect.hasLifecycleHook(type, 'ngOnChanges')}, |
| 388 | // Indicate that this directive requires the `ɵɵcontrolCreate` instruction to be generated. |
| 389 | controlCreate: reflect.hasLifecycleHook(type, 'ɵngControlCreate') |
| 390 | ? {passThroughInput: null} |
| 391 | : null, |
| 392 | typeSourceSpan: null!, |
| 393 | usesInheritance: !extendsDirectlyFromObject(type), |
| 394 | exportAs: extractExportAs(metadata.exportAs), |
| 395 | providers: metadata.providers || null, |
| 396 | viewQueries: extractQueriesMetadata(type, propMetadata, isViewQuery), |
| 397 | isStandalone: metadata.standalone === undefined ? true : !!metadata.standalone, |
| 398 | isSignal: !!metadata.signals, |
| 399 | hostDirectives: |
| 400 | metadata.hostDirectives?.map((directive) => |
| 401 | typeof directive === 'function' ? {directive} : directive, |
| 402 | ) || null, |
| 403 | }; |
| 404 | } |
| 405 | |
| 406 | /** |
| 407 | * Adds a directive definition to all parent classes of a type that don't have an Angular decorator. |
no test coverage detected
searching dependent graphs…