diff --git a/src/modules/infinite-scroll.directive.ts b/src/modules/infinite-scroll.directive.ts index 378e50cf..c5a5e753 100644 --- a/src/modules/infinite-scroll.directive.ts +++ b/src/modules/infinite-scroll.directive.ts @@ -46,11 +46,14 @@ export class InfiniteScrollDirective } ngOnChanges({ infiniteScrollContainer, infiniteScrollDisabled }: SimpleChanges) { - if (inputPropChanged(infiniteScrollContainer) || inputPropChanged(infiniteScrollDisabled)) { + var containerChanged: boolean = inputPropChanged(infiniteScrollContainer); + var disabledChanged: boolean = inputPropChanged(infiniteScrollDisabled) + + if (containerChanged || disabledChanged) { this.destroyScroller(); - if ((!inputPropChanged(infiniteScrollDisabled) && !this.infiniteScrollDisabled) || - (inputPropChanged(infiniteScrollDisabled) && !infiniteScrollDisabled.currentValue)) { + if ((!disabledChanged && !this.infiniteScrollDisabled) || + (disabledChanged && !infiniteScrollDisabled.currentValue)) { this.setup(); } }