MCPcopy Create free account
hub / github.com/angular/angular / shouldAddAbstractDirective

Function shouldAddAbstractDirective

packages/core/src/render3/jit/directive.ts:518–548  ·  view source on GitHub ↗
(type: Type<any>)

Source from the content-addressed store, hash-verified

516];
517
518function shouldAddAbstractDirective(type: Type<any>): boolean {
519 const reflect = getReflect();
520
521 if (LIFECYCLE_HOOKS.some((hookName) => reflect.hasLifecycleHook(type, hookName))) {
522 return true;
523 }
524
525 const propMetadata = reflect.propMetadata(type);
526
527 for (const field in propMetadata) {
528 const annotations = propMetadata[field];
529
530 for (let i = 0; i < annotations.length; i++) {
531 const current = annotations[i];
532 const metadataName = current.ngMetadataName;
533
534 if (
535 isInputAnnotation(current) ||
536 isContentQuery(current) ||
537 isViewQuery(current) ||
538 metadataName === 'Output' ||
539 metadataName === 'HostBinding' ||
540 metadataName === 'HostListener'
541 ) {
542 return true;
543 }
544 }
545 }
546
547 return false;
548}

Callers 1

Calls 7

getReflectFunction · 0.90
isInputAnnotationFunction · 0.85
isContentQueryFunction · 0.85
isViewQueryFunction · 0.85
someMethod · 0.80
hasLifecycleHookMethod · 0.65
propMetadataMethod · 0.65

Tested by

no test coverage detected