MCPcopy
hub / github.com/angular/angular / ɵɵqueryRefresh

Function ɵɵqueryRefresh

packages/core/src/render3/instructions/queries.ts:72–96  ·  view source on GitHub ↗
(queryList: QueryList<any>)

Source from the content-addressed store, hash-verified

70 * @codeGenApi
71 */
72export function ɵɵqueryRefresh(queryList: QueryList<any>): boolean {
73 const lView = getLView();
74 const tView = getTView();
75 const queryIndex = getCurrentQueryIndex();
76
77 setCurrentQueryIndex(queryIndex + 1);
78
79 const tQuery = getTQuery(tView, queryIndex);
80 if (
81 queryList.dirty &&
82 isCreationMode(lView) ===
83 ((tQuery.metadata.flags & QueryFlags.isStatic) === QueryFlags.isStatic)
84 ) {
85 if (tQuery.matches === null) {
86 queryList.reset([]);
87 } else {
88 const result = getQueryResults(lView, queryIndex);
89 queryList.reset(result, unwrapElementRef);
90 queryList.notifyOnChanges();
91 }
92 return true;
93 }
94
95 return false;
96}
97
98/**
99 * Loads a QueryList corresponding to the current view or content query.

Callers

nothing calls this directly

Calls 9

getLViewFunction · 0.90
getTViewFunction · 0.90
getCurrentQueryIndexFunction · 0.90
setCurrentQueryIndexFunction · 0.90
getTQueryFunction · 0.90
isCreationModeFunction · 0.90
getQueryResultsFunction · 0.90
notifyOnChangesMethod · 0.80
resetMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…