fix(ivy): mark query as dirty upon view insertion (#28429)
PR Close #28429
This commit is contained in:

committed by
Jason Aden

parent
fdc6e159b4
commit
51a592cdfc
@ -191,19 +191,21 @@ function copyQueriesToView(query: LQuery<any>| null): LQuery<any>|null {
|
||||
|
||||
function insertView(index: number, query: LQuery<any>| null) {
|
||||
while (query) {
|
||||
ngDevMode &&
|
||||
assertDefined(
|
||||
query.containerValues, 'View queries need to have a pointer to container values.');
|
||||
ngDevMode && assertViewQueryhasPointerToDeclarationContainer(query);
|
||||
query.containerValues !.splice(index, 0, query.values);
|
||||
|
||||
// mark a query as dirty only when inserted view had matching modes
|
||||
if (query.values.length) {
|
||||
query.list.setDirty();
|
||||
}
|
||||
|
||||
query = query.next;
|
||||
}
|
||||
}
|
||||
|
||||
function removeView(query: LQuery<any>| null) {
|
||||
while (query) {
|
||||
ngDevMode &&
|
||||
assertDefined(
|
||||
query.containerValues, 'View queries need to have a pointer to container values.');
|
||||
ngDevMode && assertViewQueryhasPointerToDeclarationContainer(query);
|
||||
|
||||
const containerValues = query.containerValues !;
|
||||
const viewValuesIdx = containerValues.indexOf(query.values);
|
||||
@ -219,6 +221,9 @@ function removeView(query: LQuery<any>| null) {
|
||||
}
|
||||
}
|
||||
|
||||
function assertViewQueryhasPointerToDeclarationContainer(query: LQuery<any>) {
|
||||
assertDefined(query.containerValues, 'View queries need to have a pointer to container values.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Iterates over local names for a given node and returns directive index
|
||||
|
Reference in New Issue
Block a user