I am new to AngularJS and find it very interesting, but I am a bit unclear about the following situation.
app.factory(\'deleteFac\', function($http){
var fa
.factory('POPUP', function($ionicLoading, $ionicPopup) {
var self = this;
// THIS BLOCK SCREEN ! for loading ! Be carefoull !! ( deprecated: assign this to a var for security)
self.showLoading = function(title, message, scope){
scope.loading = true;
return $ionicLoading.show({ content: message, showBackdrop: false });
};
self.hideLoading = function(title, message, scope){
scope.loading = false;
return $ionicLoading.hide();
};
// NOT BLOCK SCREEN- SIMPLE ALERTS - Standards popups
self.showAlert = function(title, message, callback){
var alertPopup = $ionicPopup.alert({ title: title, template: message });
alertPopup.then(function(res) {
console.log('callback popup');
if (callback){ callback(); }
});
};
self.showConfirm = function(objectPopup, callback){
if (objectPopup === undefined){ objectPopup = { title: 'test confirm Popup', template: 'Message test Confirm POPUP' }; }
var alertPopup = $ionicPopup.confirm(objectPopup);
alertPopup.then(function(res) {
if (res) { callback(true); }
else { callback(false); }
});
};
return self;
})