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

Function createContentQuery

packages/core/src/render3/queries/query.ts:501–519  ·  view source on GitHub ↗
(
  directiveIndex: number,
  predicate: ProviderToken<unknown> | string[] | string,
  flags: QueryFlags,
  read?: ProviderToken<T>,
)

Source from the content-addressed store, hash-verified

499}
500
501export function createContentQuery<T>(
502 directiveIndex: number,
503 predicate: ProviderToken<unknown> | string[] | string,
504 flags: QueryFlags,
505 read?: ProviderToken<T>,
506): number {
507 ngDevMode && assertNumber(flags, 'Expecting flags');
508 const tView = getTView();
509 if (tView.firstCreatePass) {
510 const tNode = getCurrentTNode()!;
511 createTQuery(tView, new TQueryMetadata_(predicate, flags, read), tNode.index);
512 saveContentQueryAndDirectiveIndex(tView, directiveIndex);
513 if ((flags & QueryFlags.isStatic) === QueryFlags.isStatic) {
514 tView.staticContentQueries = true;
515 }
516 }
517
518 return createLQuery<T>(tView, getLView(), flags);
519}
520
521/** Splits multiple selectors in the locator. */
522function splitQueryMultiSelectors(locator: string): string[] {

Callers 2

ɵɵcontentQuerySignalFunction · 0.90
ɵɵcontentQueryFunction · 0.90

Calls 7

assertNumberFunction · 0.90
getTViewFunction · 0.90
getCurrentTNodeFunction · 0.90
getLViewFunction · 0.90
createTQueryFunction · 0.85
createLQueryFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…