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

Function shouldAddAbstractDirective

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

Source from the content-addressed store, hash-verified

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

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