title: How to implement on scrolldown pagination in Angular 4
body: <p>I am new in angular 4. I want to implement scroll pagination in angular 4. Initially I want to show 20 records.
  After scroll down I want to show next 20. I will do the same till end of list.</p>
  
  <p>I tried to implement it using "angular2-infinite-scroll". but I am not able to show initially first 20 records as well scroll data.</p>
  
  <p>component file :</p>
  
  <pre><code> import { Component, OnInit } from '@angular/core';
   import { InfiniteScrollModule } from 'angular2-infinite-scroll';
  
      @Component({
        selector: 'app-scroll',
        templateUrl: `./scroll.component.html`,
        styleUrls: ['./scroll.component.css']
      })
      export class ScrollComponent implements OnInit {
  
      let item = [{
          "Name": "XYz Compnay"
      },
      {
          "Name": "XYz Company1"
      }, {
          "Name": "XYz Company2"
      }, {
          "Name": "XYz Company3"
      }, {
          "Name": "XYz Company4"
      }, {
          "Name": "XYz Company5"
      }];
        constructor() {}
        ngOnInit() {}
  
        onScroll () {
          alert('scrolled!!');    
        }
  
       }
  </code></pre>
  
  <p>HTML file :</p>
  
  <pre><code>&lt;div
           infinite-scroll
           [infiniteScrollDistance]="2"
           [infiniteScrollThrottle]="10"
           (scrolled)="onScroll()"
           &gt;
        &lt;p *ngFor="let items of item"&gt;
          {{items.Name}}
        &lt;/p&gt;
      &lt;/div&gt;  
  </code></pre>
  
  <p>If anyone having about it please share same.</p>