# Ionic2 Loading

**URL:** <https://forum.ionicframework.com/t/ionic2-loading/50692>\
**Category:** ionic-v3\
**Created:** [April 28, 2016, 8:50pm UTC](https://forum.ionicframework.com/t/ionic2-loading/50692 "2016-04-28T20:50:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![starkemc](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@starkemc](https://forum.ionicframework.com/u/starkemc)\
**Post date:** [April 28, 2016, 8:50pm UTC](https://forum.ionicframework.com/t/ionic2-loading/50692/1 "2016-04-28T20:50:15Z")

</div>

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 !

---

<div class="post-metadata">

**Author:** ![aaronksaunders](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/aaronksaunders/32/13729_2.png) [@aaronksaunders](https://forum.ionicframework.com/u/aaronksaunders)\
**Post date:** [April 28, 2016, 9:01pm UTC](https://forum.ionicframework.com/t/ionic2-loading/50692/2 "2016-04-28T21:01:33Z")

</div>

```
  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()
      }
      );
  }
```

---

<div class="post-metadata">

**Author:** ![starkemc](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@starkemc](https://forum.ionicframework.com/u/starkemc)\
**Post date:** [April 28, 2016, 9:04pm UTC](https://forum.ionicframework.com/t/ionic2-loading/50692/3 "2016-04-28T21:04:29Z")

</div>

i will give this a try !! Thank You

---

<div class="post-metadata">

**Author:** ![jaafar\_abusair](https://avatars.discourse-cdn.com/v4/letter/j/ecccb3/32.png) [@jaafar\_abusair](https://forum.ionicframework.com/u/jaafar_abusair)\
**Post date:** [August 29, 2016, 2:55pm UTC](https://forum.ionicframework.com/t/ionic2-loading/50692/4 "2016-08-29T14:55:09Z")

</div>

and what is this\_nav?
