fix(ivy): account for multiple changes between change detection runs (#24152)
PR Close #24152
This commit is contained in:
@ -272,7 +272,13 @@ export function NgOnChangesFeature(inputPropertyNames?: {[key: string]: string})
|
||||
this, PRIVATE_PREFIX, {value: simpleChanges = {}, writable: true});
|
||||
}
|
||||
const isFirstChange = !this.hasOwnProperty(privateMinKey);
|
||||
simpleChanges[propertyName] = new SimpleChange(this[privateMinKey], value, isFirstChange);
|
||||
const currentChange: SimpleChange|undefined = simpleChanges[propertyName];
|
||||
if (currentChange) {
|
||||
currentChange.currentValue = value;
|
||||
} else {
|
||||
simpleChanges[propertyName] =
|
||||
new SimpleChange(this[privateMinKey], value, isFirstChange);
|
||||
}
|
||||
if (isFirstChange) {
|
||||
// Create a place where the actual value will be stored and make it non-enumerable
|
||||
Object.defineProperty(this, privateMinKey, {value, writable: true});
|
||||
|
Reference in New Issue
Block a user