# Loading progress with spinner

**URL:** <https://forum.ionicframework.com/t/loading-progress-with-spinner/19378>\
**Category:** tutorials\
**Created:** [March 19, 2015, 2:15pm UTC](https://forum.ionicframework.com/t/loading-progress-with-spinner/19378 "2015-03-19T14:15:45Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![javanrell](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@javanrell](https://forum.ionicframework.com/u/javanrell)\
**Post date:** [March 19, 2015, 2:15pm UTC](https://forum.ionicframework.com/t/loading-progress-with-spinner/19378/1 "2015-03-19T14:15:45Z")

</div>

I could not find any well explained tutorial to do this so, once I had it working, I decided to share it. Hope someone else find this helpful.  
The main idea is to have a progress indicator on some REST actions as usually you spend some time doing comunication with a remote server. I wanted to have a message, a blocking page and a spinner, showing progress. I use the default spinner of the system so my template is only including the tags of ion-spinner.

```
.controller('AppCtrll', function($scope, $http, $ionicLoading) {
  $scope.show = function() {
    $ionicLoading.show({
      template: '<p>Loading...</p><ion-spinner></ion-spinner>'
    });
  };

  $scope.hide = function(){
        $ionicLoading.hide();
  };

  $scope.login = function() {
    // Start showing the progress
    $scope.show($ionicLoading);
    // Do the call to a service using $http or directly do the call here
    Service.service($scope, $http).success(function(data) {
      // Do something on success for example if you are doing a login
        var alertPopup = $ionicPopup.alert({
            title: 'Login successful!',
        });
    }).error(function(data) {
      // Do something on error
        var alertPopup = $ionicPopup.alert({
            title: 'Login failed!',
            template: 'Please check your credentials!'
        });
    }).finally(function($ionicLoading) { 
      // On both cases hide the loading
      $scope.hide($ionicLoading);  
    });  
  }
})
```

---

<div class="post-metadata">

**Author:** ![robypez](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/robypez/32/66701_2.png) [@robypez](https://forum.ionicframework.com/u/robypez)\
**Post date:** [March 19, 2015, 2:25pm UTC](https://forum.ionicframework.com/t/loading-progress-with-spinner/19378/2 "2015-03-19T14:25:54Z")

</div>

[http://learn.ionicframework.com/formulas/loading-screen-with-interceptors/](http://learn.ionicframework.com/formulas/loading-screen-with-interceptors/)

😄

---

<div class="post-metadata">

**Author:** ![javanrell](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@javanrell](https://forum.ionicframework.com/u/javanrell)\
**Post date:** [March 19, 2015, 7:41pm UTC](https://forum.ionicframework.com/t/loading-progress-with-spinner/19378/3 "2015-03-19T19:41:08Z")

</div>

It’s almost the same :S well at least maybe the use of spinner can be helpful …

---

<div class="post-metadata">

**Author:** ![ayajibo](https://avatars.discourse-cdn.com/v4/letter/a/a8b319/32.png) [@ayajibo](https://forum.ionicframework.com/u/ayajibo)\
**Post date:** [September 9, 2015, 11:54am UTC](https://forum.ionicframework.com/t/loading-progress-with-spinner/19378/4 "2015-09-09T11:54:18Z")

</div>

> [@javanrell](#):
>
> $ionicLoading

I used the above method, but it is still not showing.

---

<div class="post-metadata">

**Author:** ![lucasarts321](https://avatars.discourse-cdn.com/v4/letter/l/90db22/32.png) [@lucasarts321](https://forum.ionicframework.com/u/lucasarts321)\
**Post date:** [January 18, 2016, 10:12pm UTC](https://forum.ionicframework.com/t/loading-progress-with-spinner/19378/5 "2016-01-18T22:12:07Z")

</div>

Great works like a charm ! Thank you sir

---

<div class="post-metadata">

**Author:** ![jjacobs](https://avatars.discourse-cdn.com/v4/letter/j/ecccb3/32.png) [@jjacobs](https://forum.ionicframework.com/u/jjacobs)\
**Post date:** [March 30, 2016, 8:42pm UTC](https://forum.ionicframework.com/t/loading-progress-with-spinner/19378/6 "2016-03-30T20:42:08Z")

</div>

Works great! Thank you!

---

<div class="post-metadata">

**Author:** ![ahmeditage](https://avatars.discourse-cdn.com/v4/letter/a/ecccb3/32.png) [@ahmeditage](https://forum.ionicframework.com/u/ahmeditage)\
**Post date:** [February 19, 2017, 6:49am UTC](https://forum.ionicframework.com/t/loading-progress-with-spinner/19378/7 "2017-02-19T06:49:37Z")

</div>

thanks you, works great

---

<div class="post-metadata">

**Author:** ![wyinepyaesone](https://avatars.discourse-cdn.com/v4/letter/w/fbc32d/32.png) [@wyinepyaesone](https://forum.ionicframework.com/u/wyinepyaesone)\
**Post date:** [November 24, 2017, 8:46am UTC](https://forum.ionicframework.com/t/loading-progress-with-spinner/19378/8 "2017-11-24T08:46:17Z")

</div>

That’s working for me!Thank you!

---

<div class="post-metadata">

**Author:** ![freddgolden](https://avatars.discourse-cdn.com/v4/letter/f/258eb7/32.png) [@freddgolden](https://forum.ionicframework.com/u/freddgolden)\
**Post date:** [April 26, 2018, 9:06pm UTC](https://forum.ionicframework.com/t/loading-progress-with-spinner/19378/9 "2018-04-26T21:06:57Z")

</div>

hi im beginner in ionic can someone give me course or some help other doc of ionic
