$ionicLoading.hide() not working


#1

Hey,
I’m trying to remove the loading in this way $ionicLoading.hide ()
I get an error

Uncaught TypeError: Object # <Object> has no method 'hide'

Thank you!


#2

How you are creating the Loading Object ?

For example creating a Loading Object

// Show the loading overlay and text
$scope.loading = $ionicLoading.show({

        // The text to display in the loading indicator
        content: '<i class=" ion-loading-c"></i> '+ message,

        // The animation to use
        animation: 'fade-in',

        // Will a dark overlay or backdrop cover the entire view
        showBackdrop: true,

        // The maximum width of the loading indicator
        // Text will be wrapped if longer than maxWidth
        maxWidth: 200,

        // The delay in showing the indicator
        showDelay: 500
    });

Then for Hiding call $scope.loading.hide();

Regards,
Sat


#3

My code:

$ionicLoading.show({

  // The text to display in the loading indicator
  content: $scope.TextLoading,

  // The animation to use
  animation: 'fade-in',

  // Will a dark overlay or backdrop cover the entire view
  showBackdrop: true,

  // The maximum width of the loading indicator
  // Text will be wrapped if longer than maxWidth
  maxWidth: 200,

  // The delay in showing the indicator
  showDelay: 100
});

$scope.loading.hide();

not work for me


#4

First initialize the $ionicLoading object to a $scope variable. You are not doing that I see

Do ,

$scope.loading =$ionicLoading.show({<props>});

Then do,

$scope.loading.hide();


#5

I did not notice it!
It works Thank you very much!


#6

documentation should be updated since it shows a different example using an unimplemented $ionicLoading.hide() function


Update $ionicLoading.hide() documentation