diff --git a/src/modules/infinite-scroll.directive.ts b/src/modules/infinite-scroll.directive.ts index 14dd9ac2..0aa2369a 100644 --- a/src/modules/infinite-scroll.directive.ts +++ b/src/modules/infinite-scroll.directive.ts @@ -40,13 +40,19 @@ export class InfiniteScrollDirective constructor(private element: ElementRef, private zone: NgZone) {} ngAfterViewInit() { - this.setup(); + if (!this.infiniteScrollDisabled) { + this.setup(); + } } ngOnChanges({ infiniteScrollContainer, infiniteScrollDisabled }: SimpleChanges) { if (inputPropChanged(infiniteScrollContainer) || inputPropChanged(infiniteScrollDisabled)) { this.destroyScroller(); - this.setup(); + + if ((!inputPropChanged(infiniteScrollDisabled) && !this.infiniteScrollDisabled)) || + (inputPropChanged(infiniteScrollDisabled) && !infiniteScrollDisabled.currentValue)) { + this.setup(); + } } }