$ionicPopup close is not working


Hi Guys,

I’m not able to use $ionicPopup.close method. it shows following error,

I have injected $ionicPopup to the controller and ionicPopup has been shown on the screen as well.



Is there anything I’m missing out?

Thanks in advance.


read the documentation carefully how the popup service works:

the $ionicPopup-functions return a popup object you need to store. And this object has a function named close

var myPopup = $ionicPopup.show({ ... });


… or just add a button on your popover, it will close it on default


Thank you @bengtler.

I’ve tried that approach too. It gives the same error as the above example.

I’m using the ionic framework version - driftyco/ionic-bower#1.0.0

Let me know if it helps out.

Thanks again.



Thanks for responding.

I’m trying to close a popup on onPause event. But I realized the close function do not work from same controller too.

Please share your views.

Thank you.


if you are listen on a native javascript and not an angular event your code is executed outside the angularjs context --> the solution: Wrap your AngularJS-Code in your event-callback in $timeout(function () { … });.


document.addEventListener('pause', function () {
    $timeout(function () {
}, false);

PS: Do not forget to load $timeout in your controller and be sure the pause-event gets triggered!



Thanks for the help. It worked like a charm.


This error also occurs when using promises:

//It's not working
var myPopup = $ionicPopup.show({ ... })
//close method vanished!
//It's working
var myPopup = $ionicPopup.show({ ... });