MCPcopy Index your code
hub / github.com/angular/angular / shouldAddAbstractDirective

Function shouldAddAbstractDirective

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

Source from the content-addressed store, hash-verified

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

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…