$ionicPopup freezes app


#1

I am calling $ionicPopup.alert on a button click event. If i quickly presses button it shows multiple popups and after closing last popup app freezes with lighting effects.

This issue is occuring on all platforms (IOS, Android, wp8 and bb10).


#2

I use it from ionic official page and it works.

 // An alert dialog

$scope.showAlert = function() {
var alertPopup = $ionicPopup.alert({
title: ‘Don’t eat that!’,
template: ‘It might taste good’
});
alertPopup.then(function(res) {
console.log(‘Thank you for not eating my delicious ice cream cone’);
});
};


#3

if i use multiple popup then it happens like,

function () {
var alertPopup = $ionicPopup.alert({
title: ‘Don’t eat that!’,
template: ‘It might taste good’
});
alertPopup.then(function(res) {
console.log(‘Thank you for not eating my delicious ice cream cone’);
});

alertPopup = $ionicPopup.alert({
title: ‘Don’t eat that!’,
template: ‘It might taste good’
});
alertPopup.then(function(res) {
console.log(‘Thank you for not eating my delicious ice cream cone’);
});
}
this will freeze the app.

Is there anyway to run them sync without calling next alert in then function.


#4

Change the variable name for multiple popup like:

var alertPopup and var alertPopup1 and var alertPopup2 etc.

and use alertPopup.then and alertPopup1.then and alertPopup2.then etc.

Hope it will work.

If you call multiple popup in one function using one variable then it will be confused that which have to show for this reason the problem occurs , So change the variable name and give a condition when which alert will work. @maqeelqureshi