title: ionic 2 infinite scroll error
body: <p>I'm trying to do infinite scroll in ionic2 but whenever the page loads i get this error <code>Cannot read property 'complete' of undefined</code></p>
  
  <p>HTML</p>
  
  <pre><code>&lt;ion-content&gt;
  
   &lt;ion-list&gt;
     &lt;ion-item *ngFor="let item of posts" (click)="passurl($event,item)"&gt;
       &lt;h2&gt;{{item.title}}&lt;/h2&gt;
       &lt;/ion-item&gt;
   &lt;/ion-list&gt;
  
   &lt;ion-infinite-scroll (ionInfinite)="ionViewDidLoad($event)"&gt;
     &lt;ion-infinite-scroll-content&gt;&lt;/ion-infinite-scroll-content&gt;
   &lt;/ion-infinite-scroll&gt;
  
  &lt;/ion-content&gt;
  </code></pre>
  
  <p>JS</p>
  
  <pre><code>ionViewDidLoad(infiniteScroll){
      let loader = this.LoadingController.create({
      content: 'Please Wait'
      });
      loader.present().then(()=&gt;{
        this.http.get('http://mynewweb/templates/messages/titles.php?church_id='+ this.church_id+'&amp;msg_type='+this.NavParams.data.id+ "&amp;page="+this.page).map(res =&gt; res.json()).subscribe(data =&gt;{
              console.log(JSON.stringify(data));
              setTimeout(() =&gt; {
              for(var i=0;i&lt;data.length;i++){
                this.numofposts = data.length;
              this.posts.push(data[i]);
               }
          infiniteScroll.complete();
            }, 500);
          });
       this.page=this.page+1;
      loader.dismiss();
      });
  
    }
  </code></pre>
  
  <p>i followed the documentation on the ionic2 framework from their website. any help with this? thanks</p>