I'm encountering an issue in my Ionic/Cordova application where I am trying to implement a loading message using $ionicLoading, but I keep getting the error:
ReferenceError: $ionicLoading is not defined
Does anyone know how I can successfully pass $ionicLoading into my service?
Any help would be greatly appreciated.
/**
* Service for handling calls
*/
.factory('DialService', function() {
return {
makeCall: function(number) {
$ionicLoading.show({
template: 'TEST',
duration: 1000
});
window.cordova.plugins.DirectCallPlugin.call(number, callSuccessCallback, callFailCallback);
}
};
var callSuccessCallback = function() {
console.log("Success call");
};
var callFailCallback = function() {
console.log("Call failed");
$ionicLoading.show({
template: 'Error during call dial',
duration: 1000
});
};
});