Hi, I saw in the documentation that you can set a time.
There is a callback event?
I would like to make something happen it’s hidden.
$ionicLoading.show({
template: 'Test',
duration: 1000
});
Hi, I saw in the documentation that you can set a time.
There is a callback event?
I would like to make something happen it’s hidden.
$ionicLoading.show({
template: 'Test',
duration: 1000
});
Why don’t you do it like this:
$scope.loadingIndicator = $ionicLoading.show({
template: 'Test'
});
$timeout(function(){
$scope.loadingIndicator.hide();
// Do whatever you want to do
},1000);
I don’t really like this approach, I was hoping there was a callback type
.onComplete(){
// Do whatever you want to do
}
With time out if I wanted to change view would be instantaneous…
A callback doesn’t exist, precisely because you can use it like I showed you
mmm… You do not lose the effect of fadeout?
$ionicLoading.show({ template: ‘Sending.’, noBackdrop: true, duration: 2000 });
reduce the duration from 1000 to less you should not see it for long enough
Using $timeout doesn’t answer the OP’s question. He needs to run a function after the show
function is completed.
Hello, this is the right way to do it:
$ionicLoading.show({
template: 'Loading...'
}).then(function(){
//the function you want to execute after showing..
console.log("The loading indicator is now displayed");
});
or for hide:
$ionicLoading.hide().then(function(){
//The function you want to execute after hide..
console.log("The loading indicator is now hidden");
});