title: Ionic 3 Infinite Scroll End When No More Data Is Found
body: <p>I am using json to data and what I want to do is I need to end infinite scroll once no more data is available.
  How can I implement this.
  Here is the code -</p>
  
  <pre><code>    loadData(currentCount) {
      this.http.get('http://www.exapmle.com/feed.php?page=' + this.currentCount).map(res =&gt; res.json()).subscribe(data =&gt; {
          this.posts1 = data;
          let i = 0;
          for (let v in this.posts1) {
              if (i &lt; 4) {
                  this.slidesdata.push(this.posts1[v]);
              } else {
                  this.posts.push(this.posts1[v]);
              }
              i++;
          }
      });
  }
  
      doInfinite(infiniteScroll: any) {
      this.currentCount = this.currentCount + 1;
      this.http.get('http://www.exapmle.com/feed.php?page=' + this.currentCount).map(res =&gt; res.json()).subscribe(data =&gt; {
          this.newposts1 = data;
          this.newposts = this.newposts1;
          for (let i in this.newposts) {
              this.posts.push(this.newposts[i]);
          }
          infiniteScroll.complete();
      });
  }
  </code></pre>