Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70429

$ionicLoading doesn't show on device

$
0
0

@ln206 wrote:

Hello all,

$ionicLoading works fine on browser (ionic serve), but when I test it on my device (HTC One M8), it doesn't show up, could anyone explain why?

Basically, I followed the tutorial here http://learn.ionicframework.com/formulas/loading-screen-with-interceptors/,

I'm trying to get a loading shows up for every http request. Here's the code in my .run function

  $rootScope.$on('loading:show', function() {
       $ionicLoading.show({
          template: '<span style="color: #ffffff;">Loading...</span>'
       })
  });

  $rootScope.$on('loading:hide', function() {
        $ionicLoading.hide()
  });

And here's the code in my .config function

$httpProvider.interceptors.push(function($rootScope) {
  return {
    request: function(config) {
      $rootScope.$broadcast('loading:show');
      return config;
    },
    response: function(response) {
      $rootScope.$broadcast('loading:hide');
      return response;
    }
  }
});

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70429

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>