Skip to content

Commit

Permalink
perf(module:table): spawn timers and add listener outside of the zone (
Browse files Browse the repository at this point in the history
  • Loading branch information
arturovt authored Feb 24, 2022
1 parent 5a5df13 commit ec248c9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions components/table/src/table/table-inner-scroll.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,13 @@ export class NzTableInnerScrollComponent<T> implements OnChanges, AfterViewInit,
overflowX: this.scrollX ? 'auto' : null,
maxHeight: this.scrollY
};
this.scroll$.next();
// Caretaker note: we have to emit the value outside of the Angular zone, thus DOM timer (`delay(0)`) and `scroll`
// event listener will be also added outside of the Angular zone.
this.ngZone.runOutsideAngular(() => this.scroll$.next());
}
if (data) {
this.data$.next();
// See the comment above.
this.ngZone.runOutsideAngular(() => this.data$.next());
}
}
ngAfterViewInit(): void {
Expand Down

0 comments on commit ec248c9

Please sign in to comment.