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

Function createLQuery

packages/core/src/render3/queries/query.ts:477–486  ·  view source on GitHub ↗

* Creates a new instance of LQuery and returns its index in the collection of LQuery objects. * * @returns index in the collection of LQuery objects

(tView: TView, lView: LView, flags: QueryFlags)

Source from the content-addressed store, hash-verified

475 * @returns index in the collection of LQuery objects
476 */
477function createLQuery<T>(tView: TView, lView: LView, flags: QueryFlags): number {
478 const queryList = new QueryList<T>(
479 (flags & QueryFlags.emitDistinctChangesOnly) === QueryFlags.emitDistinctChangesOnly,
480 );
481
482 storeCleanupWithContext(tView, lView, queryList, queryList.destroy);
483
484 const lQueries = (lView[QUERIES] ??= new LQueries_()).queries;
485 return lQueries.push(new LQuery_(queryList)) - 1;
486}
487
488export function createViewQuery<T>(
489 predicate: ProviderToken<unknown> | string[] | string,

Callers 2

createViewQueryFunction · 0.85
createContentQueryFunction · 0.85

Calls 2

storeCleanupWithContextFunction · 0.90
pushMethod · 0.45

Tested by

no test coverage detected