Created
August 9, 2017 07:18
-
-
Save ventouris/797c61c38727258040eb704c83c31613 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getTransportations() { | |
let loader = this.loadingController.create({ | |
content: 'Getting data...' | |
}); | |
loader.present(); | |
return this.wpApi.getTransportations(this.maxResults) | |
.then( (data) => { | |
if ( data.status == 200 ) { | |
this.transportantions = data.response.entries; | |
} else { | |
console.log('Something was wrong. Error status ' + data.status); | |
} | |
loader.dismiss(); | |
}) | |
.catch(function (err) { | |
loader.dismiss(); | |
console.log('something was wrong: ' + err); | |
}); | |
} | |
doInfinite(infiniteScroll:any) { | |
this.maxResults += 10; | |
this.getTransportations().then(()=>{ | |
infiniteScroll.complete(); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment