Skip to content
This repository was archived by the owner on Jun 22, 2020. It is now read-only.

Commit b4f37af

Browse files
committed
fixup
1 parent ee64e81 commit b4f37af

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

projects/table-builder/src/lib/table/directives/observer-view.directive.ts

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,23 @@ export class ObserverViewDirective implements AfterViewInit, OnDestroy {
1010
constructor(private element: ElementRef, private readonly ngZone: NgZone) {}
1111

1212
public ngAfterViewInit(): void {
13-
this.ngZone.runOutsideAngular(() => {
14-
this.observer = new IntersectionObserver(
15-
(entries: IntersectionObserverEntry[]): void => {
16-
entries.forEach(
17-
(entry: IntersectionObserverEntry): void => {
18-
this.ngZone.runOutsideAngular((): void => this.observeChange(entry));
19-
this.previousRation = entry.intersectionRatio;
20-
}
21-
);
22-
},
23-
{
24-
root: null,
25-
rootMargin: '0px 0px 0px 0px',
26-
threshold: [0]
27-
}
28-
);
13+
this.ngZone.runOutsideAngular(
14+
(): void => {
15+
this.observer = new IntersectionObserver(
16+
(entries: IntersectionObserverEntry[]): void => {
17+
entries.forEach(
18+
(entry: IntersectionObserverEntry): void => {
19+
this.ngZone.runOutsideAngular((): void => this.observeChange(entry));
20+
this.previousRation = entry.intersectionRatio;
21+
}
22+
);
23+
},
24+
{ root: null, rootMargin: '0px 0px 0px 0px', threshold: [0] }
25+
);
2926

30-
this.observer.observe(this.element.nativeElement);
31-
});
27+
this.observer.observe(this.element.nativeElement);
28+
}
29+
);
3230
}
3331

3432
public ngOnDestroy(): void {

0 commit comments

Comments
 (0)