Enabling and disabling a loader in ionic application - cordova

Enabling or showing a loader and disabling it in ionic application is quite easy. Loader is used to inform the end user of a progress or activity, restricting the user for further actions. Below are the sample code for showing and hiding an ionic loader.

Sample Code:

Enable Loader:

$ionicLoading.show({
    template: 'Loading InProgress'
}).then(function(){
     console.log("Loader is now enabled");
});

Remove Loader:

$ionicLoading.hide().then(function(){
     console.log("Loader Removed");
});

 

Category: