Hi
I just import my REST API Wordpress posts to ionic and everything works great
but the main page Home where all posts load there is very very slow in scrolling and load data from wordpress
maybe because it provide all posts in the page without loading
how can I make it fast ??
would something like infinite-scroll because i try to put in my code but it not working?
here’s some codes maybe it cause the slow in main page I believe there’s something wrong in mycode here
Home.ts
constructor(public navCtrl: NavController, public wpProvider: WpProvider, public loadingCtrl: LoadingController) {
this.presentLoading()
this.posts = this.wpProvider.getPosts();
this.posts.subscribe(data =>
this.loader.dismiss());
}
Home.html
<ion-content>
<ion-card *ngFor="let post of posts | async" (click)="openPost(post)" tappable>
<img [src]="post.media_url | async">
<ion-item>
<ion-avatar item-left>
<img [src]="getUserImage(post.authorId)">
</ion-avatar>
<h2>{{ getUserName(post.authorId) }}</h2>
</ion-item>
<ion-card-content>
<ion-card-title>
{{ post.title }}
</ion-card-title>
<div [innerHTML]="post.excerpt"></div>
</ion-card-content>
</ion-card>
</ion-content>
could anybody anyone help me ?