Does anyone have a decent example of the loading component working with data. The examples they always show displays the loading box for a few seconds then it goes away. I need it to display while my data is loading and have it disappear afterward.
Thanks !
getItems() {
// clean up the string, if empty then exit
let q = this.searchQuery.trim()
if (q == '') {
return;
}
let loading = Loading.create({
content: 'Searching, Please Wait...'
});
this._nav.present(loading);
// have a string, do the search
this._dataService.getSearchResults(q)
.subscribe(
// process the results..
(data) => {
console.log('search results', data.hits)
this.items = data.hits
},
// handle an error condition...
(err) => alert("Error Searching: " + err),
// called when completely done processing
() => {
console.log("All Good With The Data");
loading.dismiss()
}
);
}
i will give this a try !! Thank You