JavaScript Edu Resources. Angular Courses. React Tutorials. Join us!

angular2-infinite-scroll

An Infinite Scroll Directive for Angular2 (based on Observables)

  • By default, the directive listens to the window scroll event and invoked the callback.
  • To trigger the callback when the actual element is scrolled, these settings should be configured:

    First, import the InfiniteScrollModule to your module:

    In this example, the onScroll callback will be invoked when the window is scrolled down:

    in this example, whenever the “search-results” is scrolled, the callback will be invoked:

    In this example, the onScrollDown callback will be invoked when the window is scrolled down and the onScrollUp callback will be invoked when the window is scrolled up:



angular2-infinite-scroll

Comments are closed, but trackbacks and pingbacks are open.