Can i create global ionic loader?

Hi @mhartington

How to display the loader between two transition view ?
Can you help me?

             function(event, toState, toParams, fromState, fromParams){ 

  $scope.$on('$stateChangeSuccess', function(event, toState, toParams, fromState, fromParams) {
1 Like

The response given by @mhartington is good, but let me ask you why do you want to put a loader between transitions? I think that this effect may cause a false sensation of slowness to your app.

Maybe you want to consider a loading only when the app is fetching data from the server.

Right, this is a simplified use case that will fire on every state change. You could follow this tutorial to create a loader during an $http request.

app.config(function($httpProvider) {
  $httpProvider.interceptors.push(function($rootScope) {
    return {
      request: function(config) {
        return config
      response: function(response) {
        return response

Thanks… :slight_smile: It is working…

I am using push notification.OnTap on notification on notification bar. In That case $ionicPlatform.ready is executing two time… :frowning: How can i resolve?