Hello there,
I’m quite new with Ionic and I don’t understand how the component “infinite-scroll” works.
A lot of tutorials about this component are made with a random user generator on Internet, but I would like to do it with datas I made myself, such those ones :
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { InfiniteScroll } from 'ionic-angular';
@Component({
selector: 'page-administrateur',
templateUrl: 'administrateur.html'
})
export class Administrateur {
infiniteScroll: InfiniteScroll;
users = [
{firstName : "Julie", lastName : "Aubret", mail : "julieaubret@outlook.fr"},
{firstName : "Thomas", lastName : "Perrot", mail : "thomasperrot@outlook.fr"},
{firstName : "Maxime", lastName : "Le Feuvre", mail : "maximelefeuvre@outlook.fr"},
{firstName : "Mewen", lastName : "Le Pogam", mail : "mewenlepogam@outlook.fr"},
{firstName : "Aziliz", lastName : "Abollivier", mail : "azilizabollivier@outlook.fr"},
{firstName : "Thibault", lastName : "Herledan", mail : "thibaultherledan@outlook.fr"},
{firstName : "Sophie", lastName : "Puybareau", mail : "sophiepuybareau@outlook.fr"},
{firstName : "Kévin", lastName : "Le Manach", mail : "kevinlemanach@outlook.fr"}
];
page = 0;
maximumPages = 3;
constructor(public navCtrl: NavController) {
this.loadUsers();
}
loadUsers(infiniteScroll?) {
if (infiniteScroll) {
infiniteScroll.complete();
}
}
loadMore(infiniteScroll) {
this.page++;
this.loadUsers(infiniteScroll);
if (this.page === this.maximumPages) {
infiniteScroll.enable(false);
}
}
}
And all what I get is this :
Any idea about how to solve this?
Thanks by advance