fix(ivy): Content Queries inheritance fix (#28324)
Prior to this change contentQueriesRefresh functions that represent refresh logic for @ContentQuery list were not composable, which caused problems in case one Directive inherits another one and both of them contain Content Queries. Due to the fact that we used indices to reference queries in refresh function, results were placed into wrong Queries. In order to avoid that we no longer use indices to reference queries and instead maintain current content query index while iterating through them. This allows us to compose contentQueriesRefresh functions and make inheritance feature work with Content Queries. PR Close #28324
This commit is contained in:

committed by
Jason Aden

parent
ebac5dba38
commit
bb94434d85
@ -257,18 +257,18 @@ export function setBindingRoot(value: number) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Current index of a View Query which needs to be processed next.
|
||||
* We iterate over the list of View Queries stored in LView and increment current query index.
|
||||
* Current index of a View or Content Query which needs to be processed next.
|
||||
* We iterate over the list of Queries and increment current query index at every step.
|
||||
*/
|
||||
let viewQueryIndex: number = 0;
|
||||
let currentQueryIndex: number = 0;
|
||||
|
||||
export function getCurrentViewQueryIndex(): number {
|
||||
export function getCurrentQueryIndex(): number {
|
||||
// top level variables should not be exported for performance reasons (PERF_NOTES.md)
|
||||
return viewQueryIndex;
|
||||
return currentQueryIndex;
|
||||
}
|
||||
|
||||
export function setCurrentViewQueryIndex(value: number): void {
|
||||
viewQueryIndex = value;
|
||||
export function setCurrentQueryIndex(value: number): void {
|
||||
currentQueryIndex = value;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user