I have followed this to update angular https://github.com/driftyco/ionic/blob/master/CHANGELOG.md
the app loads fine and pages are working fine…except that im getting error on ion-refresher
and ion-infinite
this is the doRefresh function:
doRefresh(refresh){
if (this.con.isOnline()){
setTimeout(() => {
this.jobsData.load().subscribe(res => {
console.log(this.jobs[0]) // returns fine
console.log(this.jobs) // returns fine
this.updatedJobs = res;
if (this.jobs[0].id === this.updatedJobs[0].id){ /// error here , not sure why
this.presentToastfailure()
} else {
this.presentToastsuccess()
this.jobs = res;
this.local.localData(res)
}
refresh.complete();
});
});
I get Cannot read property '0' of undefined
even through the array return fine when i console log
doInfinite(infiniteScroll){
if (this.con.isOnline()){
setTimeout(() => {
this.jobsData.nextPage(this.next).subscribe(res => {
for(let i of res){ // error here apparently
this.jobs.push(i);
}
infiniteScroll.complete();
})
this.next++;
}, 1000);
i get Cannot read property 'length' of undefined
I couldn’t figure out the problem, if I downgrade back to 2.2.1
everything works fine